From c3a0fde28f4866bc6df368456de0bb86c663229e Mon Sep 17 00:00:00 2001 From: JD Horelick Date: Tue, 23 Feb 2010 19:50:45 -0500 Subject: [PATCH] Added cycle_host_change option. --- doc/example.conf | 1 + doc/reference.conf | 6 ++++++ include/s_conf.h | 1 + modules/m_info.c | 6 ++++++ src/newconf.c | 1 + src/s_conf.c | 1 + src/s_user.c | 2 +- 7 files changed, 17 insertions(+), 1 deletion(-) diff --git a/doc/example.conf b/doc/example.conf index 7218668..a7417ff 100755 --- a/doc/example.conf +++ b/doc/example.conf @@ -347,6 +347,7 @@ channel { burst_topicwho = yes; kick_on_split_riding = no; only_ascii_channels = no; + cycle_host_change = yes; resv_forcepart = yes; }; diff --git a/doc/reference.conf b/doc/reference.conf index 8702c6e..db409ec 100755 --- a/doc/reference.conf +++ b/doc/reference.conf @@ -761,6 +761,12 @@ channel { * or non-ASCII). */ only_ascii_channels = no; + + /* cycle_host_change: Should a user be cycled in the channels + * they're in when their host changes. If set to no, this may + * cause client desyncs. + */ + cycle_host_change = 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 70c755c..a31e098 100644 --- a/include/s_conf.h +++ b/include/s_conf.h @@ -236,6 +236,7 @@ struct config_channel_entry int burst_topicwho; int kick_on_split_riding; int only_ascii_channels; + int cycle_host_change; int resv_forcepart; }; diff --git a/modules/m_info.c b/modules/m_info.c index d3ddb3b..fb5632e 100644 --- a/modules/m_info.c +++ b/modules/m_info.c @@ -548,6 +548,12 @@ static struct InfoStruct info_table[] = { &ConfigChannel.only_ascii_channels, "Controls whether non-ASCII is disabled for JOIN" }, + { + "cycle_host_change", + OUTPUT_BOOLEAN_YN, + &ConfigChannel.cycle_host_change, + "Controls if when a users' host changes, they cycle channels", + }, { "use_except", OUTPUT_BOOLEAN_YN, diff --git a/src/newconf.c b/src/newconf.c index 8b93cf8..df55304 100644 --- a/src/newconf.c +++ b/src/newconf.c @@ -2215,6 +2215,7 @@ static struct ConfEntry conf_channel_table[] = { "no_create_on_split", CF_YESNO, NULL, 0, &ConfigChannel.no_create_on_split }, { "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 }, { "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 74eecc5..0528d1d 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -755,6 +755,7 @@ set_default_conf(void) ConfigChannel.max_bans = 25; ConfigChannel.max_bans_large = 500; ConfigChannel.only_ascii_channels = NO; + ConfigChannel.cycle_host_change = YES; ConfigChannel.burst_topicwho = NO; ConfigChannel.kick_on_split_riding = NO; diff --git a/src/s_user.c b/src/s_user.c index 31e56af..441012c 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -1435,7 +1435,7 @@ change_nick_user_host(struct Client *target_p, const char *nick, const char *use struct membership *mscptr; int changed = irccmp(target_p->name, nick); int changed_case = strcmp(target_p->name, nick); - int do_qjm = irccmp(target_p->username, user) || irccmp(target_p->host, host); + int do_qjm = irccmp(target_p->username, user) || (irccmp(target_p->host, host) && ConfigChannel.cycle_host_change); char mode[10], modeval[NICKLEN * 2 + 2], reason[256], *mptr; va_list ap;