diff options
author | miwob <michael@wobst.at> | 2016-01-13 15:58:13 +0100 |
---|---|---|
committer | miwob <michael@wobst.at> | 2016-01-13 16:23:22 +0100 |
commit | 7f418a58da1781b5b815f75a50caf4338f380af0 (patch) | |
tree | e32b1d2b0b2ccc78d136064bfc372ac883858f11 /modules/protocol/hybrid.cpp | |
parent | 10aeba2da208fb24702c8385aa1eed50369f03d0 (diff) |
hybrid.cpp: clean up style to match with other code; update copyright header
Diffstat (limited to 'modules/protocol/hybrid.cpp')
-rw-r--r-- | modules/protocol/hybrid.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp index e50c335d9..ad8679aa1 100644 --- a/modules/protocol/hybrid.cpp +++ b/modules/protocol/hybrid.cpp @@ -1,7 +1,7 @@ /* ircd-hybrid-8 protocol module * * (C) 2003-2014 Anope Team - * (C) 2012-2015 ircd-hybrid development team + * (C) 2012-2016 ircd-hybrid development team * * Please read COPYING and README for further details. * @@ -19,6 +19,7 @@ class HybridProto : public IRCDProto BotInfo *FindIntroduced() { BotInfo *bi = Config->GetClient("OperServ"); + if (bi && bi->introduced) return bi; @@ -29,9 +30,9 @@ class HybridProto : public IRCDProto return NULL; } - void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override + void SendSVSKillInternal(const MessageSource &source, User *u, const Anope::string &buf) anope_override { - IRCDProto::SendSVSKillInternal(source, user, buf); + IRCDProto::SendSVSKillInternal(source, u, buf); user->KillInternal(source, buf); } @@ -111,23 +112,21 @@ class HybridProto : public IRCDProto UplinkSocket::Message(Config->GetClient("OperServ")) << "UNRESV * " << x->mask; } - void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override + void SendJoin(User *u, Channel *c, const ChannelStatus *status) anope_override { /* - * Note that we must send our modes with the SJOIN and - * can not add them to the mode stacker because ircd-hybrid - * does not allow *any* client to op itself + * Note that we must send our modes with the SJOIN and can not add them to the + * mode stacker because ircd-hybrid does not allow *any* client to op itself */ - UplinkSocket::Message() << "SJOIN " << c->creation_time << " " << c->name << " +" - << c->GetModes(true, true) << " :" - << (status != NULL ? status->BuildModePrefixList() : "") << user->GetUID(); + UplinkSocket::Message() << "SJOIN " << c->creation_time << " " << c->name << " +" << c->GetModes(true, true) << " :" + << (status != NULL ? status->BuildModePrefixList() : "") << u->GetUID(); /* And update our internal status for this user since this is not going through our mode handling system */ - if (status != NULL) + if (status) { - ChanUserContainer *uc = c->FindUser(user); + ChanUserContainer *uc = c->FindUser(u); - if (uc != NULL) + if (uc) uc->status = *status; } } @@ -186,22 +185,20 @@ class HybridProto : public IRCDProto UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password << " TS 6 :" << Me->GetSID(); /* - * As of October 13, 2012, ircd-hybrid-8 does support the following capabilities + * As of January 13, 2016, ircd-hybrid-8 does support the following capabilities * which are required to work with IRC-services: * * QS - Can handle quit storm removal * EX - Can do channel +e exemptions - * CHW - Can do channel wall @# * IE - Can do invite exceptions - * KNOCK - Supports KNOCK + * CHW - Can do channel wall @# * TBURST - Supports topic burst * ENCAP - Supports ENCAP * HOPS - Supports HalfOps * SVS - Supports services * EOB - Supports End Of Burst message - * TS6 - Capable of TS6 support */ - UplinkSocket::Message() << "CAPAB :QS EX CHW IE ENCAP TBURST SVS HOPS EOB TS6"; + UplinkSocket::Message() << "CAPAB :QS EX CHW IE ENCAP TBURST SVS HOPS EOB"; SendServer(Me); @@ -330,6 +327,7 @@ struct IRCDMessageBMask : IRCDMessage { spacesepstream bans(params[3]); Anope::string token; + while (bans.GetToken(token)) c->SetModeInternal(source, mode, token); } @@ -436,9 +434,11 @@ struct IRCDMessageSJoin : IRCDMessage void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { Anope::string modes; + if (params.size() >= 3) for (unsigned i = 2; i < params.size() - 1; ++i) modes += " " + params[i]; + if (!modes.empty()) modes.erase(modes.begin()); @@ -486,6 +486,7 @@ struct IRCDMessageSVSMode : IRCDMessage void Run(MessageSource &source, const std::vector<Anope::string> ¶ms) anope_override { User *u = User::Find(params[0]); + if (!u) return; |