From 0d112886980787ffd5c69e514eebe476bcec8343 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 7 Dec 2016 15:23:29 -0500 Subject: Fix numerics to be sent to uids --- include/protocol.h | 2 +- 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)...); 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 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 -- cgit