X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcmd_privmsg.cpp;h=71e121a522bd6f2164b484934e3a131818096b4d;hb=cd7657bddc7a6dc2e7326077d173a874bf71f6bd;hp=26e63dfb95e1262fbef4dfa8ca0a81554dbfeeea;hpb=f911684c7da03ffaa0fbc5335dbe53d05dc05f71;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cmd_privmsg.cpp b/src/cmd_privmsg.cpp index 26e63dfb9..71e121a52 100644 --- a/src/cmd_privmsg.cpp +++ b/src/cmd_privmsg.cpp @@ -18,9 +18,7 @@ #include "wildcard.h" #include "commands/cmd_privmsg.h" - - -extern "C" command_t* init_command(InspIRCd* Instance) +extern "C" DllExport command_t* init_command(InspIRCd* Instance) { return new cmd_privmsg(Instance); } @@ -37,14 +35,14 @@ CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user) if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 0)) return CMD_SUCCESS; - if ((parameters[0][0] == '$') && ((*user->oper) || (ServerInstance->ULine(user->server)))) + if ((parameters[0][0] == '$') && (IS_OPER(user) || ServerInstance->ULine(user->server))) { int MOD_RESULT = 0; std::string temp = parameters[1]; FOREACH_RESULT(I_OnUserPreMessage,OnUserPreMessage(user,(void*)parameters[0],TYPE_SERVER,temp,0,except_list)); if (MOD_RESULT) return CMD_FAILURE; - parameters[1] = (char*)temp.c_str(); + parameters[1] = temp.c_str(); // notice to server mask const char* servermask = parameters[0] + 1; if (match(ServerInstance->Config->ServerName,servermask)) @@ -64,7 +62,7 @@ CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user) { chan = ServerInstance->FindChan(parameters[0]); - except_list[user] = user; + except_list[user] = user->nick; if (chan) { @@ -90,7 +88,7 @@ CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user) } parameters[1] = temp.c_str(); - if (temp == "") + if (temp.empty()) { user->WriteServ("412 %s No text to send", user->nick); return CMD_FAILURE; @@ -126,7 +124,7 @@ CmdResult cmd_privmsg::Handle (const char** parameters, int pcnt, userrec *user) dest = ServerInstance->FindNick(parameters[0]); if (dest) { - if ((IS_LOCAL(user)) && (*dest->awaymsg)) + if (IS_AWAY(dest)) { /* auto respond with aweh msg */ user->WriteServ("301 %s %s :%s",user->nick,dest->nick,dest->awaymsg);