]> jfr.im git - irc/evilnet/x3.git/commitdiff
Added a couple mode missing channel autojoin modes (for mod-snoop and mod-track)
authorMatthew Beeching <redacted>
Wed, 19 Mar 2014 01:25:59 +0000 (01:25 +0000)
committerMatthew Beeching <redacted>
Wed, 19 Mar 2014 01:25:59 +0000 (01:25 +0000)
src/mod-snoop.c
src/mod-track.c
x3.conf.example

index 15b57201071e188205cef274750cefe81f508346..c06135bdc7cd347f29f14f88d7d5f525043ea417 100644 (file)
@@ -286,15 +286,16 @@ snoop_channel_mode(struct userNode *who, struct chanNode *channel, char **modes,
 static void
 snoop_conf_read(void) {
     dict_t node;
-    char *str;
+    char *str, *modes;
 
     node = conf_get_data("modules/snoop", RECDB_OBJECT);
     if (!node)
         return;
     str = database_get_data(node, "channel", RECDB_QSTRING);
+    modes = database_get_data(node, "channel_modes", RECDB_QSTRING);
     if (!str)
         return;
-    snoop_cfg.channel = AddChannel(str, now, "+sntim", NULL, NULL);
+    snoop_cfg.channel = AddChannel(str, now, (modes ? modes : "+sntim"), NULL, NULL);
     if (!snoop_cfg.channel)
         return;
     str = database_get_data(node, "show_bursts", RECDB_QSTRING);
index d88d143b7e5f50a143bc3c92c348f8bd2cc8963e..a14d8ec49cb1dabb8ef87f1a1b5d9a57e8d9687b 100644 (file)
@@ -624,7 +624,7 @@ MODCMD_FUNC(cmd_listtrack)
 static void
 track_conf_read(void) {
     dict_t node;
-    char *str;
+    char *str, *modes;
 
     node = conf_get_data("modules/track", RECDB_OBJECT);
     if (!node)
@@ -635,11 +635,12 @@ track_conf_read(void) {
     else
            parse_track_conf(str);
     str = database_get_data(node, "channel", RECDB_QSTRING);
+    modes = database_get_data(node, "channel_modes", RECDB_QSTRING);
     if (!str)
         return;
     // XXX - dont do addchannel if the channel is being shared with
     // another module:
-    track_cfg.channel = AddChannel(str, now, "+sntOm", NULL, NULL);
+    track_cfg.channel = AddChannel(str, now, (modes ? modes : "+sntOm"), NULL, NULL);
     if (!track_cfg.channel)
         return;
     str = database_get_data(node, "show_bursts", RECDB_QSTRING);
index c0e384e0eaeee9c667ffba5b8bfe131b49af71d2..93858026f8f99a00b5d3ce3d18ed18712311cf35 100644 (file)
     "snoop" {
         // Where to send snoop messages?
         "channel" "#MrSnoopy";
+        "channel_modes" "+sntim";
         // Which bot?
         "bot" "O3";
         // Show new users and joins from net joins?  (off by default)
         "snomask" "nick,join,part,kick,new,del,auth,chanmode,umode";
         // Where to send snoop messages?
         "channel" "#MrPeanuts";
+        "channel_modes" "+sntOm";
         // Which bot?
         "bot" "O3";
         // Show new users and joins from net joins?  (off by default)