diff --git a/TODO-SHADOW b/TODO-SHADOW index 6523896..ef71372 100644 --- a/TODO-SHADOW +++ b/TODO-SHADOW @@ -16,7 +16,6 @@ Todo list for Shadowircd 6.0 * config options to strip colours and bold and such from user PART and QUIT messages. * channel::exemptchanops config option * nonicks cmode -* channel::host_in_topic option (can be a vector for idiots seeing host-in-topic) * host-on-operup: vhost that gets applied to you on oper-up. A surprising number of people want this. * change *line duration to support "human-readable" format (ie: 3d6h5m) diff --git a/doc/example.conf b/doc/example.conf index a7417ff..1066bec 100755 --- a/doc/example.conf +++ b/doc/example.conf @@ -348,6 +348,7 @@ channel { kick_on_split_riding = no; only_ascii_channels = no; cycle_host_change = yes; + host_in_topic = yes; resv_forcepart = yes; }; diff --git a/doc/reference.conf b/doc/reference.conf index db409ec..47ba7ff 100755 --- a/doc/reference.conf +++ b/doc/reference.conf @@ -767,6 +767,12 @@ channel { * cause client desyncs. */ cycle_host_change = yes; + + /* host_in_topic: Defines whether or not the topicsetter's + * host is shown when users request the TOPIC. If this option + * is set to no, it will only show the nick of the topicsetter. + */ + host_in_topic = yes; /* resv_forcepart: force any local users to part a channel * when a RESV is issued. diff --git a/include/s_conf.h b/include/s_conf.h index a31e098..69a80b5 100644 --- a/include/s_conf.h +++ b/include/s_conf.h @@ -237,6 +237,7 @@ struct config_channel_entry int kick_on_split_riding; int only_ascii_channels; int cycle_host_change; + int host_in_topic; int resv_forcepart; }; diff --git a/modules/m_info.c b/modules/m_info.c index fb5632e..49c8512 100644 --- a/modules/m_info.c +++ b/modules/m_info.c @@ -554,6 +554,12 @@ static struct InfoStruct info_table[] = { &ConfigChannel.cycle_host_change, "Controls if when a users' host changes, they cycle channels", }, + { + "host_in_topic", + OUTPUT_BOOLEAN_YN, + &ConfigChannel.host_in_topic, + "Defines whether a topicsetters host or just nick is shown on TOPIC", + }, { "use_except", OUTPUT_BOOLEAN_YN, diff --git a/modules/m_topic.c b/modules/m_topic.c index 7e6206e..3eee639 100644 --- a/modules/m_topic.c +++ b/modules/m_topic.c @@ -117,8 +117,13 @@ m_topic(struct Client *client_p, struct Client *source_p, int parc, const char * if((chptr->mode.mode & MODE_TOPICLIMIT) == 0 || is_chanop(msptr)) { char topic_info[USERHOST_REPLYLEN]; - rb_sprintf(topic_info, "%s!%s@%s", - source_p->name, source_p->username, source_p->host); + + if(ConfigChannel.host_in_topic) + rb_sprintf(topic_info, "%s!%s@%s", + source_p->name, source_p->username, source_p->host); + else + rb_strlcpy(topic_info, source_p->name, sizeof(topic_info)); + set_channel_topic(chptr, parv[2], topic_info, rb_current_time()); sendto_server(client_p, chptr, CAP_TS6, NOCAPS, diff --git a/src/newconf.c b/src/newconf.c index df55304..2701306 100644 --- a/src/newconf.c +++ b/src/newconf.c @@ -2216,6 +2216,7 @@ static struct ConfEntry conf_channel_table[] = { "no_join_on_split", CF_YESNO, NULL, 0, &ConfigChannel.no_join_on_split }, { "only_ascii_channels", CF_YESNO, NULL, 0, &ConfigChannel.only_ascii_channels }, { "cycle_host_change", CF_YESNO, NULL, 0, &ConfigChannel.cycle_host_change }, + { "host_in_topic", CF_YESNO, NULL, 0, &ConfigChannel.host_in_topic }, { "use_except", CF_YESNO, NULL, 0, &ConfigChannel.use_except }, { "use_invex", CF_YESNO, NULL, 0, &ConfigChannel.use_invex }, { "use_knock", CF_YESNO, NULL, 0, &ConfigChannel.use_knock }, diff --git a/src/s_conf.c b/src/s_conf.c index 0528d1d..2257fb1 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -756,6 +756,7 @@ set_default_conf(void) ConfigChannel.max_bans_large = 500; ConfigChannel.only_ascii_channels = NO; ConfigChannel.cycle_host_change = YES; + ConfigChannel.host_in_topic = YES; ConfigChannel.burst_topicwho = NO; ConfigChannel.kick_on_split_riding = NO;