X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcmd_privmsg.cpp;h=71e121a522bd6f2164b484934e3a131818096b4d;hb=0306a4231e85baeb5029ef2b9b36d0b5d241d147;hp=d83e71662892ad5e53c193ccce5aea6a46ece941;hpb=13fcf22eaba873290e0f04484fc75bcd339d4fa3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cmd_privmsg.cpp b/src/cmd_privmsg.cpp index d83e71662..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) { @@ -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);