+ /* If there is a topic mask set, and the new topic doesnt match,
+ * set the topic to mask + new_topic */
+ if(cData->topic_mask && !match_ircglob(channel->topic, cData->topic_mask))
+ {
+ char new_topic[TOPICLEN+1];
+ conform_topic(cData->topic_mask, channel->topic, new_topic);
+ if(*new_topic)
+ {
+ SetChannelTopic(channel, chanserv, new_topic, 1);
+ /* and fall through to topicsnarf code below.. */
+ }
+ else /* Topic couldnt fit into mask, was too long */
+ {
+ SetChannelTopic(channel, chanserv, old_topic, 1);
+ send_message(user, chanserv, "CSMSG_TOPICMASK_CONFLICT1", channel->name, cData->topic_mask);
+ send_message(user, chanserv, "CSMSG_TOPICMASK_CONFLICT2", TOPICLEN);
+ return 1;
+ }
+ }