Pass is_notice status to chanmsg funcs.
authorThiefMaster <thiefmaster@gamesurge.net>
Fri, 7 Mar 2008 01:53:47 +0000 (02:53 +0100)
committerMichael Poole <mdpoole@troilus.org>
Sun, 9 Mar 2008 00:42:25 +0000 (19:42 -0500)
src/chanserv.c
src/modcmd.c
src/proto-common.c
src/proto.h

index aa86929eeed55bb104f7e6ad64ee8aa46799ba5b..d2f26938697b94a4c996c8ce246e3e5ce83a3c0c 100644 (file)
@@ -798,7 +798,7 @@ scan_user_presence(struct userData *uData, struct userNode *user)
 }
 
 static void
-chanserv_ctcp_check(struct userNode *user, struct chanNode *channel, const char *text, UNUSED_ARG(struct userNode *bot))
+chanserv_ctcp_check(struct userNode *user, struct chanNode *channel, const char *text, UNUSED_ARG(struct userNode *bot), UNUSED_ARG(unsigned int is_notice))
 {
     unsigned int eflags, argc;
     char *argv[4];
index 65f8d296e58651006d111427030190cd85de9cb3..9fd76a4c83e19239eae98de2b97b9b7881cd2a65 100644 (file)
@@ -888,10 +888,12 @@ modcmd_privmsg(struct userNode *user, struct userNode *bot, const char *text, in
 }
 
 void
-modcmd_chanmsg(struct userNode *user, struct chanNode *chan, const char *text, struct userNode *bot) {
+modcmd_chanmsg(struct userNode *user, struct chanNode *chan, const char *text, struct userNode *bot, unsigned int is_notice) {
     struct service *service;
-    if (!(service = dict_find(services, bot->nick, NULL))) return;
+    if (!(service = dict_find(services, bot->nick, NULL)))
+        return;
     svccmd_invoke(user, service, chan, text, 0);
+    (void)is_notice;
 }
 
 struct service *
index 618643c831414d54d30223a25acf78123c943a6a..f6a852f7ad06ff214223350e2ae22f9b01eb0bc6 100644 (file)
@@ -442,8 +442,9 @@ privmsg_chan_helper(struct chanNode *cn, void *data)
 
     /* Never send a NOTICE to a channel to one of the services */
     cf = &chanmsg_funcs[(unsigned char)pd->text[0]];
-    if (!pd->is_notice && cf->func && GetUserMode(cn, cf->service) && !IsDeaf(cf->service))
-        cf->func(pd->user, cn, pd->text+1, cf->service);
+    if (cf->func && !pd->is_notice
+        && GetUserMode(cn, cf->service) && !IsDeaf(cf->service))
+        cf->func(pd->user, cn, pd->text+1, cf->service, pd->is_notice);
 
     /* This catches *all* text sent to the channel that the services server sees */
     for (x = 0; x < ALLCHANMSG_FUNCS_MAX; x++) {
@@ -451,7 +452,7 @@ privmsg_chan_helper(struct chanNode *cn, void *data)
        if (!cf->func)
            break; /* end of list */
        else
-           cf->func(pd->user, cn, pd->text, cf->service);
+           cf->func(pd->user, cn, pd->text, cf->service, pd->is_notice);
     }
 }
 
index 04ccb78171ad0cfd5fb3312e1549f245aa2a6c89..cfee7c5e2a65d361a4065a1e2ab821268a5b0c20 100644 (file)
@@ -90,7 +90,7 @@ void init_parse(void);
 int parse_line(char *line, int recursive);
 
 /* Callback notifications for protocol support. */
-typedef void (*chanmsg_func_t) (struct userNode *user, struct chanNode *chan, const char *text, struct userNode *bot);
+typedef void (*chanmsg_func_t) (struct userNode *user, struct chanNode *chan, const char *text, struct userNode *bot, unsigned int is_notice);
 void reg_chanmsg_func(unsigned char prefix, struct userNode *service, chanmsg_func_t handler);
 void reg_allchanmsg_func(struct userNode *service, chanmsg_func_t handler);
 struct userNode *get_chanmsg_bot(unsigned char prefix);