]> jfr.im git - irc/evilnet/x3.git/commitdiff
Some mod-track fixups, and make x3 kicking a user report correctly in all modules
authorrubin <redacted>
Fri, 19 May 2006 03:59:23 +0000 (03:59 +0000)
committerrubin <redacted>
Fri, 19 May 2006 03:59:23 +0000 (03:59 +0000)
ChangeLog
src/hash.c
src/mod-track.c
src/proto-p10.c

index df792970266c724f893b8059c426105566343679..c8712483ddd94d4f6dcdf74bc72385e324c21604 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,20 +3,30 @@
 
 2006-05-18  Alex Schumann  <rubin@afternet.org>
 
-    * chanserv.c: adding 'classic' view, via patch submitted by pLaYa
+       * src/proto-p10.c: Fixed up the track module a bit more
 
-       * nickserv.c: adding 'classic' view, via patch submitted by pLaYa
+       * src/hash.c: Fixed up the track module a bit more, including
+       reporting correctly when X3 kicks someone. This should affect mrsnoopy
+       as well, hopefully wont cause any bugs.
 
-       * nickserv.h: adding 'classic' view, via patch submitted by pLaYa
+       * src/mod-track.c: Fixed up the track module a bit more
 
-       * nickserv.help: adding 'classic' view, via patch submitted by pLaYa
+2006-05-18  Alex Schumann  <rubin@afternet.org>
+
+       * src/chanserv.c: adding 'classic' view, via patch submitted by pLaYa
+
+       * src/nickserv.c: adding 'classic' view, via patch submitted by pLaYa
+
+       * src/nickserv.h: adding 'classic' view, via patch submitted by pLaYa
+
+       * src/nickserv.help: adding 'classic' view, via patch submitted by pLaYa
 
 2006-05-18  Alex Schumann  <rubin@afternet.org>
 
-       * chanserv.c: re-disabled netrider kicking. Somehow this got included back
+       * src/chanserv.c: re-disabled netrider kicking. Somehow this got included back
        in.
 
-       * mod-track.c: some cleanups and textual changes, to make the commands
+       * src/mod-track.c: some cleanups and textual changes, to make the commands
        slightly more user friendly.
 
 2006-05-16  Neil Spierling  <sirvulcan@gmail.com>
index 31730f14e02183dc3ac290cb2656588cc348ad99..ebf2d9a497e924a99d1065dcfe84d0f1f3812a2e 100644 (file)
@@ -607,11 +607,21 @@ DelChannelUser(struct userNode* user, struct chanNode* channel, const char *reas
         DelChannel(channel);
 }
 
+static kick_func_t *kf_list;
+static unsigned int kf_size = 0, kf_used = 0;
+
 void
 KickChannelUser(struct userNode* target, struct chanNode* channel, struct userNode *kicker, const char *why)
 {
+    unsigned int n;
+
     if (!target || !channel || IsService(target) || !GetUserMode(channel, target))
         return;
+
+    /* This may break things, but lets see.. -Rubin */
+    for (n=0; n<kf_used; n++)
+        kf_list[n](kicker, target, channel);
+
     /* don't remove them from the channel, since the server will send a PART */
     irc_kick(kicker, target, channel, why);
 
@@ -623,9 +633,6 @@ KickChannelUser(struct userNode* target, struct chanNode* channel, struct userNo
     }
 }
 
-static kick_func_t *kf_list;
-static unsigned int kf_size = 0, kf_used = 0;
-
 void
 reg_kick_func(kick_func_t handler)
 {
index 77b18848baaca717c20f55c9578ed300c3ab4257..16684910af569fcb3d266691f0861aa9ec235858 100644 (file)
@@ -219,7 +219,7 @@ track_part(struct modeNode *mn, const char *reason) {
 static void
 track_kick(struct userNode *kicker, struct userNode *victim, struct chanNode *chan) {
     if (!track_cfg.enabled) return;
-    if (check_track_kick(track_cfg) && (check_track_user(kicker) || check_track_user(victim)))
+    if (check_track_kick(track_cfg) && ((check_track_user(kicker) || check_track_user(victim))))
     {
            UPDATE_TIMESTAMP();
            TRACK("$bKICK$b %s from %s by %s", victim->nick, chan->name, (kicker ? kicker->nick : "some server"));
@@ -291,7 +291,7 @@ track_channel_mode(struct userNode *who, struct chanNode *channel, char **modes,
        if(who)
        {
                if (who->uplink->burst && !track_cfg.show_bursts) return;
-               if (!check_track_chanmode(track_cfg) && !check_track_user(who)) return;
+               if (!check_track_chanmode(track_cfg) || !check_track_user(who)) return;
        } else
                return;
 
@@ -454,7 +454,10 @@ MODCMD_FUNC(cmd_track)
                                TRACK("$bALERT$b TRACK disabled by %s", user->nick);
                        }
                        else
-                               TRACK("Unrecognised parameter: %s", data);
+                        {
+                                send_message_type(4, user, track_cfg.bot, "Unrecognised parameter: %s", data);
+                                svccmd_send_help_brief(user, track_cfg.bot, cmd);
+                        }
                        return 0;
                }
 
@@ -588,8 +591,10 @@ MODCMD_FUNC(cmd_deltrack)
                        send_message_type(4, user, track_cfg.bot, "This nick isn't monitored.");
        }
        else
+    {
                send_message_type(4, user, track_cfg.bot, "No nick or invalid nick specified.");
         svccmd_send_help_brief(user, track_cfg.bot, cmd);
+    }
        return 0;
 }
 
@@ -603,10 +608,13 @@ MODCMD_FUNC(cmd_addtrack)
                UPDATE_TIMESTAMP();
                TRACK("$bALERT$b Manually enabled monitoring of %s!%s@%s on %s requested by %s",
                                un->nick, un->ident, un->hostname, un->uplink->name, user->nick);
+        send_message_type(4, user, track_cfg.bot, "Now tracking %s!%s@%s on %s", un->nick,un->ident,un->hostname, un->uplink->name);
        }
        else
+    {
                send_message_type(4, user, track_cfg.bot, "No nick or invalid nick specified.");
         svccmd_send_help_brief(user, track_cfg.bot, cmd);
+    }
        return 0;
 }
 
@@ -642,7 +650,9 @@ track_conf_read(void) {
     str = database_get_data(node, "channel", RECDB_QSTRING);
     if (!str)
         return;
-    track_cfg.channel = AddChannel(str, now, "+sntim", NULL, NULL);
+    // XXX - dont do addchannel if the channel is being shared with
+    // another module:
+    track_cfg.channel = AddChannel(str, now, "+sntOm", NULL, NULL);
     if (!track_cfg.channel)
         return;
     str = database_get_data(node, "show_bursts", RECDB_QSTRING);
index b27fc34924810503d54bfb95acdb939b61504b43..c75ae806b878244b66e6809d99d817cd10f5375f 100644 (file)
@@ -1904,6 +1904,11 @@ init_parse(void)
     /* We have reliable clock!  Always!  Wraaa! */
     dict_insert(irc_func_dict, CMD_SETTIME, cmd_dummy);
     dict_insert(irc_func_dict, TOK_SETTIME, cmd_dummy);
+
+    /* ignore /trace and /motd commands targetted at us */
+    dict_insert(irc_func_dict, TOK_TRACE, cmd_dummy);
+    dict_insert(irc_func_dict, TOK_MOTD, cmd_dummy);
+
     /* handle topics */
     dict_insert(irc_func_dict, "331", cmd_num_topic);
     dict_insert(irc_func_dict, "332", cmd_num_topic);