]> jfr.im git - irc/freenode/ircd-seven.git/commitdiff
Make 5614c9e6f0b (opmod as fake statusmsg) optional
authorJanik Kleinhoff <redacted>
Tue, 27 Feb 2018 22:49:13 +0000 (22:49 +0000)
committerEd Kellett <redacted>
Mon, 6 Jul 2020 09:36:35 +0000 (10:36 +0100)
This adds a channel { ... } option, opmod_send_statusmsg, disabled by
default for compatibility reasons.

doc/ircd.conf.example
doc/reference.conf
include/s_conf.h
ircd/newconf.c
ircd/s_conf.c
ircd/send.c
modules/m_info.c

index dbe97c2b98c531bccefa5d23b2ca8fd280e44754..40dbfe80e5c0da52f7f863c40c0f37dd4a15e13c 100644 (file)
@@ -374,6 +374,7 @@ channel {
        autochanmodes = "+nt";
        displayed_usercount = 3;
        strip_topic_colors = no;
+       opmod_send_statusmsg = no;
 };
 
 serverhide {
index 72af51828d9b25c82b2870119986c61e1bc10a78..64270b46d9eb714043290d99cb7140adafd48828 100644 (file)
@@ -837,6 +837,11 @@ channel {
 
        /* strip_topic_colors: whether or not color codes in TOPIC should be stripped. */
        strip_topic_colors = no;
+
+       /* opmod_send_statusmsg: format messages sent to ops due to +z
+        * as PRIVMSG @#channel when sent to clients.
+        */
+       opmod_send_statusmsg = no;
 };
 
 
index fec5c8a84fab35e5e44c25616f684453b566d4b4..94a3b8f77e04c85630886e611ab327226cea44af 100644 (file)
@@ -273,6 +273,7 @@ struct config_channel_entry
        unsigned int autochanmodes;
        int displayed_usercount;
        int strip_topic_colors;
+       int opmod_send_statusmsg;
 };
 
 struct config_server_hide
index b69c3bfc1224834e9c9588ad88bc683b11164856..5d9bdf8ffe4939de1692765c90f1269106f2ea11 100644 (file)
@@ -2830,6 +2830,7 @@ static struct ConfEntry conf_channel_table[] =
        { "autochanmodes",      CF_QSTRING, conf_set_channel_autochanmodes, 0, NULL     },
        { "displayed_usercount",        CF_INT, NULL, 0, &ConfigChannel.displayed_usercount     },
        { "strip_topic_colors", CF_YESNO, NULL, 0, &ConfigChannel.strip_topic_colors    },
+       { "opmod_send_statusmsg", CF_YESNO, NULL, 0, &ConfigChannel.opmod_send_statusmsg        },
        { "\0",                 0,        NULL, 0, NULL }
 };
 
index 2021185127571eafcfd324040f1d9b4a16d08af7..33077c1fedb5b9886bce68206c85c4d8e74233f7 100644 (file)
@@ -804,6 +804,7 @@ set_default_conf(void)
        ConfigChannel.channel_target_change = true;
        ConfigChannel.disable_local_channels = false;
        ConfigChannel.displayed_usercount = 3;
+       ConfigChannel.opmod_send_statusmsg = false;
 
        ConfigChannel.autochanmodes = MODE_TOPICLIMIT | MODE_NOPRIVMSGS;
 
index 1ecddab7e7b388aa346e6bebf4808c9a83850c40..d2a92d16a381c464b7bb5ac9e6f65d96ecd2c9e3 100644 (file)
@@ -598,22 +598,23 @@ sendto_channel_opmod(struct Client *one, struct Client *source_p,
        build_msgbuf_tags(&msgbuf, source_p);
 
        current_serial++;
+       const char *statusmsg_prefix = (ConfigChannel.opmod_send_statusmsg ? "@" : "");
 
        if(IsServer(source_p)) {
                msgbuf_cache_initf(&msgbuf_cache, &msgbuf, &strings,
-                              ":%s %s @%s :",
-                              source_p->name, command, chptr->chname);
+                              ":%s %s %s%s :",
+                              source_p->name, command, statusmsg_prefix, chptr->chname);
        } else {
                msgbuf_cache_initf(&msgbuf_cache, &msgbuf, &strings,
-                              ":%s!%s@%s %s @%s :",
+                              ":%s!%s@%s %s %s%s :",
                               source_p->name, source_p->username,
-                              source_p->host, command, chptr->chname);
+                              source_p->host, command, statusmsg_prefix, chptr->chname);
        }
 
        if (chptr->mode.mode & MODE_MODERATED) {
                linebuf_put_msgf(&rb_linebuf_old, &strings,
-                              ":%s %s @%s :",
-                              use_id(source_p), command, chptr->chname, text);
+                              ":%s %s %s%s :",
+                              use_id(source_p), command, statusmsg_prefix, chptr->chname, text);
        } else {
                linebuf_put_msgf(&rb_linebuf_old, &strings,
                               ":%s NOTICE @%s :<%s:%s> ",
@@ -623,7 +624,6 @@ sendto_channel_opmod(struct Client *one, struct Client *source_p,
        linebuf_put_msgf(&rb_linebuf_new, &strings,
                       ":%s %s =%s :",
                       use_id(source_p), command, chptr->chname);
-
        RB_DLINK_FOREACH_SAFE(ptr, next_ptr, chptr->members.head)
        {
                msptr = ptr->data;
index d3c8e8c0c9c88ff2668bd0ab496a2714e5ca96d7..fa930084aa425fde6a775bd2eaf54f731986d821 100644 (file)
@@ -632,6 +632,12 @@ static struct InfoStruct info_table[] = {
                &ConfigChannel.resv_forcepart,
                "Force-part local users on channel RESV"
        },
+       {
+               "opmod_send_statusmsg",
+               OUTPUT_BOOLEAN_YN,
+               &ConfigChannel.opmod_send_statusmsg,
+               "Send messages to @#channel if affected by +z"
+       },
        {
                "disable_hidden",
                OUTPUT_BOOLEAN_YN,