diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd_notice.cpp | 11 | ||||
-rw-r--r-- | src/cmd_privmsg.cpp | 10 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 1 |
3 files changed, 17 insertions, 5 deletions
diff --git a/src/cmd_notice.cpp b/src/cmd_notice.cpp index f43b6cd20..a797fefab 100644 --- a/src/cmd_notice.cpp +++ b/src/cmd_notice.cpp @@ -48,7 +48,7 @@ CmdResult cmd_notice::Handle (const char** parameters, int pcnt, userrec *user) { user->SendAll("NOTICE", "%s", parameters[1]); } - FOREACH_MOD(I_OnUserMessage,OnUserNotice(user,(void*)parameters[0],TYPE_SERVER,parameters[1],0,exempt_list)); + FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,(void*)parameters[0],TYPE_SERVER,parameters[1],0,exempt_list)); return CMD_SUCCESS; } char status = 0; @@ -89,7 +89,7 @@ CmdResult cmd_notice::Handle (const char** parameters, int pcnt, userrec *user) if (temp.empty()) { - user->WriteServ("412 %s No text to send", user->nick); + user->WriteServ("412 %s :No text to send", user->nick); return CMD_FAILURE; } @@ -123,8 +123,13 @@ CmdResult cmd_notice::Handle (const char** parameters, int pcnt, userrec *user) dest = ServerInstance->FindNick(parameters[0]); if (dest) { + if (!*parameters[1]) + { + user->WriteServ("412 %s :No text to send", user->nick); + return CMD_FAILURE; + } + int MOD_RESULT = 0; - std::string temp = parameters[1]; FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(user,dest,TYPE_USER,temp,0,exempt_list)); if (MOD_RESULT) { diff --git a/src/cmd_privmsg.cpp b/src/cmd_privmsg.cpp index 71e121a52..f3295df07 100644 --- a/src/cmd_privmsg.cpp +++ b/src/cmd_privmsg.cpp @@ -27,7 +27,6 @@ CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user) { userrec *dest; chanrec *chan; - CUList except_list; user->idle_lastmsg = ServerInstance->Time(); @@ -88,9 +87,10 @@ CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user) } parameters[1] = temp.c_str(); + /* Check again, a module may have zapped the input string */ if (temp.empty()) { - user->WriteServ("412 %s No text to send", user->nick); + user->WriteServ("412 %s :No text to send", user->nick); return CMD_FAILURE; } @@ -124,6 +124,12 @@ CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user) dest = ServerInstance->FindNick(parameters[0]); if (dest) { + if (!*parameters[1]) + { + user->WriteServ("412 %s :No text to send", user->nick); + return CMD_FAILURE; + } + if (IS_AWAY(dest)) { /* auto respond with aweh msg */ diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index a134d95e1..e99af2e7d 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -851,6 +851,7 @@ void ModuleSpanningTree::OnUserNotice(userrec* user, void* dest, int target_type void ModuleSpanningTree::OnUserMessage(userrec* user, void* dest, int target_type, const std::string &text, char status, const CUList &exempt_list) { + ServerInstance->Log(DEBUG,"Message='%s'", text.c_str()); if (target_type == TYPE_USER) { // route private messages which are targetted at clients only to the server |