diff options
author | Adam <Adam@anope.org> | 2016-12-07 15:23:29 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2016-12-07 15:23:29 -0500 |
commit | 0d112886980787ffd5c69e514eebe476bcec8343 (patch) | |
tree | 23dead512c6ecb9b18dc30760f480d23e8d7f061 | |
parent | 30e78efa8f835ab37c29700c4b4593285281ba84 (diff) |
Fix numerics to be sent to uids
-rw-r--r-- | include/protocol.h | 2 | ||||
-rw-r--r-- | modules/protocol/inspircd20.cpp | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/include/protocol.h b/include/protocol.h index 50d16d7b3..ee782903b 100644 --- a/include/protocol.h +++ b/include/protocol.h @@ -414,7 +414,7 @@ void IRCDProto::SendNumeric(int numeric, User *dest, Args&&... args) if (numeric < 100) numstr.insert(numstr.begin(), '0'); - IRCMessage message(Me, numstr, dest->nick); + IRCMessage message(Me, numstr, dest->GetUID()); message.Push(std::forward<Args>(args)...); SendNumeric(numeric, dest, message); } diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index d7bff8be0..3a3c13619 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -223,7 +223,18 @@ class InspIRCd20Proto : public IRCDProto void SendNumeric(int numeric, User *dest, IRCMessage &message) { - Uplink::Send("PUSH", dest->GetUID(), Format(message)); + std::vector<Anope::string> params = message.GetParameters(); + if (params.empty()) + return; + + /* First parameter is the UID, change it to nick because it is pushed */ + params[0] = dest->nick; + + IRCMessage m(message.GetSource(), message.GetCommand()); + for (const Anope::string &s : params) + m.Push(s); + + Uplink::Send("PUSH", dest->GetUID(), Format(m)); } void SendMode(const MessageSource &source, Channel *dest, const Anope::string &buf) override |