Added channel::host_in_topic.

This commit is contained in:
JD Horelick 2010-02-23 20:19:58 -05:00
parent ccac85bf9c
commit 45b9f1cbc0
8 changed files with 23 additions and 3 deletions

View File

@ -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)

View File

@ -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;
};

View File

@ -768,6 +768,12 @@ channel {
*/
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.
*/

View File

@ -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;
};

View File

@ -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,

View File

@ -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,

View File

@ -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 },

View File

@ -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;