aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_callerid.cpp
diff options
context:
space:
mode:
authorGravatar Attila Molnar2014-01-21 18:44:08 +0100
committerGravatar Attila Molnar2014-01-21 18:44:08 +0100
commite244cb2c63b1ac1d85bdbb4691f7b1bd940ae804 (patch)
tree5a69b0efe6c0b7ab88925d3d066271ec40845e23 /src/modules/m_callerid.cpp
parentm_spanningtree Fix routing of ROUTE_TYPE_MESSAGE messages (diff)
parentRelease 2.0.15 (diff)
Merge insp20
Diffstat (limited to 'src/modules/m_callerid.cpp')
-rw-r--r--src/modules/m_callerid.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp
index 3dc932958..6f2c67300 100644
--- a/src/modules/m_callerid.cpp
+++ b/src/modules/m_callerid.cpp
@@ -158,13 +158,18 @@ class CommandAccept : public Command
*/
typedef std::pair<User*, bool> ACCEPTAction;
- static ACCEPTAction GetTargetAndAction(std::string& tok)
+ static ACCEPTAction GetTargetAndAction(std::string& tok, User* cmdfrom = NULL)
{
bool remove = (tok[0] == '-');
if ((remove) || (tok[0] == '+'))
tok.erase(tok.begin());
- User* target = ServerInstance->FindNick(tok);
+ User* target;
+ if (!cmdfrom || !IS_LOCAL(cmdfrom))
+ target = ServerInstance->FindNick(tok);
+ else
+ target = ServerInstance->FindNickOnly(tok);
+
if ((!target) || (target->registered != REG_ALL) || (target->quitting) || (IS_SERVER(target)))
target = NULL;
@@ -216,7 +221,7 @@ public:
}
std::string tok = parameters[0];
- ACCEPTAction action = GetTargetAndAction(tok);
+ ACCEPTAction action = GetTargetAndAction(tok, user);
if (!action.first)
{
user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", tok.c_str());
@@ -248,7 +253,7 @@ public:
// Find the target
std::string targetstring = parameters[0];
- ACCEPTAction action = GetTargetAndAction(targetstring);
+ ACCEPTAction action = GetTargetAndAction(targetstring, user);
if (!action.first)
// Target is a "*" or source is local and the target is a list of nicks
return ROUTE_LOCALONLY;