summaryrefslogtreecommitdiff
path: root/modules/protocol/hybrid.cpp
diff options
context:
space:
mode:
authorDukePyrolator <DukePyrolator@anope.org>2012-10-14 20:13:41 +0200
committerDukePyrolator <DukePyrolator@anope.org>2012-10-14 20:13:41 +0200
commit88f10a2c3cc4c23bb67409a5589f93a55e8b0b49 (patch)
tree2909010a4efaf0c46acd7dccc295bc36704e37fb /modules/protocol/hybrid.cpp
parentffa1c976f5fec5bd344cd332e84b465728a9fb49 (diff)
Updated the hybrid protocol module, patch provided by Michael
- Change mode handler to use UIDs within SVSMODE messages - The IP can be 0 in UID messages depending whether or not a client is spoofed - Removed SendGlobopsInternal handler. Anope is using GLOBOPS by default - Set user's services timestamp/account to 0 instead of 1 on /ns logout, otherwise the UID message handler will
Diffstat (limited to 'modules/protocol/hybrid.cpp')
-rw-r--r--modules/protocol/hybrid.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp
index 917b1a86e..88d10a841 100644
--- a/modules/protocol/hybrid.cpp
+++ b/modules/protocol/hybrid.cpp
@@ -37,11 +37,6 @@ class HybridProto : public IRCDProto
UplinkSocket::Message(bi) << "PRIVMSG $$" << dest->GetName() << " :" << msg;
}
- void SendGlobopsInternal(const BotInfo *bi, const Anope::string &buf) anope_override
- {
- UplinkSocket::Message(bi) << "GLOBOPS :" << buf;
- }
-
void SendSQLine(User *, const XLine *x) anope_override
{
const BotInfo *bi = findbot(Config->OperServ);
@@ -211,9 +206,9 @@ class HybridProto : public IRCDProto
void SendModeInternal(const BotInfo *bi, const User *u, const Anope::string &buf) anope_override
{
if (bi)
- UplinkSocket::Message(bi) << "SVSMODE " << u->nick << " " << u->timestamp << " " << buf;
+ UplinkSocket::Message(bi) << "SVSMODE " << u->GetUID() << " " << u->timestamp << " " << buf;
else
- UplinkSocket::Message(Me) << "SVSMODE " << u->nick << " " << u->timestamp << " " << buf;
+ UplinkSocket::Message(Me) << "SVSMODE " << u->GetUID() << " " << u->timestamp << " " << buf;
}
void SendLogin(User *u) anope_override
@@ -227,7 +222,7 @@ class HybridProto : public IRCDProto
{
const BotInfo *ns = findbot(Config->NickServ);
- ircdproto->SendMode(ns, u, "+d 1");
+ ircdproto->SendMode(ns, u, "+d 0");
}
void SendChannel(Channel *c) anope_override
@@ -580,9 +575,14 @@ struct IRCDMessageUID : IRCDMessage
/* :0MC UID Steve 1 1350157102 +oi ~steve resolved.host 10.0.0.1 0MCAAAAAB 1350157108 :Mining all the time */
bool Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
{
+ Anope::string ip = params[6];
+
+ if (ip == "0") /* Can be 0 for spoofed clients */
+ ip.clear();
+
/* Source is always the server */
User *user = new User(params[0], params[4], params[5], "",
- params[6], source.GetServer(),
+ ip, source.GetServer(),
params[9], params[2].is_pos_number_only() ? convertTo<time_t>(params[2]) : 0,
params[3], params[7]);