1
0
mirror of https://github.com/anope/anope.git synced 2026-07-04 05:33:12 +02:00

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
This commit is contained in:
DukePyrolator
2012-10-14 20:13:41 +02:00
parent ffa1c976f5
commit 88f10a2c3c
+9 -9
View File
@@ -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]);