diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-11-28 14:10:32 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-11-28 14:10:32 +0000 |
commit | 29e5cbb53350050a70b4b4b130627a56b4d34be6 (patch) | |
tree | be2b25bf9f46e239c43dfcb39d32e863aedf0a48 /src | |
parent | 36b32f6c0547b821565270806a986f7035bffaef (diff) |
Made privmsgs work
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1976 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/commands.cpp | 7 | ||||
-rw-r--r-- | src/modules/m_spanningtree.cpp | 5 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/commands.cpp b/src/commands.cpp index d07b2e1fe..a584f9372 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -617,9 +617,11 @@ void handle_privmsg(char **parameters, int pcnt, userrec *user) return; } + log(DEBUG,"*** PRIVMSG HANDLER"); dest = Find(parameters[0]); if (dest) { + log(DEBUG,"*** FOUND NICK %s",dest->nick); if (strcmp(dest->awaymsg,"")) { /* auto respond with aweh msg */ @@ -635,9 +637,10 @@ void handle_privmsg(char **parameters, int pcnt, userrec *user) } parameters[1] = (char*)temp.c_str(); - if (!strcmp(dest->server,user->server)) + if (!strcmp(dest->server,ServerName)) { // direct write, same server + log(DEBUG,"*** CALL WRITETO"); WriteTo(user, dest, "PRIVMSG %s :%s", dest->nick, parameters[1]); } @@ -714,7 +717,7 @@ void handle_notice(char **parameters, int pcnt, userrec *user) } parameters[1] = (char*)temp.c_str(); - if (!strcmp(dest->server,user->server)) + if (!strcmp(dest->server,ServerName)) { // direct write, same server WriteTo(user, dest, "NOTICE %s :%s", dest->nick, parameters[1]); diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 7f42456bd..e5494c236 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -654,6 +654,7 @@ class TreeSocket : public InspSocket { strparams[q] = (char*)params[q].c_str(); } + log(DEBUG,"*** CALL COMMAND HANDLER FOR %s, SOURCE: '%s'",command.c_str(),who->nick); Srv->CallCommandHandler(command, strparams, params.size(), who); } else @@ -890,7 +891,7 @@ class ModuleSpanningTree : public Module virtual void OnUserMessage(userrec* user, void* dest, int target_type, std::string text) { - if (target_type = TYPE_USER) + if (target_type == TYPE_USER) { // route private messages which are targetted at clients only to the server // which needs to receive them @@ -900,7 +901,7 @@ class ModuleSpanningTree : public Module std::deque<std::string> params; params.clear(); params.push_back(d->nick); - params.push_back(text); + params.push_back(":"+text); DoOneToOne(user->nick,"PRIVMSG",params,d->server); } } |