1 From d8eddbeaadc7d161865b5342d59748b80266533c Mon Sep 17 00:00:00 2001
2 From: DukePyrolator <DukePyrolator@anope.org>
3 Date: Mon, 22 Aug 2011 14:53:37 +0200
4 Subject: [PATCH 03/16] Update ngIRCd protocol module for current Anope 1.9
8 modules/protocol/ngircd.cpp | 37 ++++++++++++++++++-------------------
9 1 files changed, 18 insertions(+), 19 deletions(-)
11 diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
12 index e546d05..790b8f4 100644
13 --- a/modules/protocol/ngircd.cpp
14 +++ b/modules/protocol/ngircd.cpp
19 +#include "nickserv.h"
23 {"ngIRCd", /* ircd name */
24 @@ -45,14 +47,7 @@ class ngIRCdProto : public IRCDProto
26 void SendAkill(User *u, const XLine *x)
28 - if (SGLine && u == NULL)
29 - for (Anope::insensitive_map<User *>::iterator it = UserListByNick.begin(); it != UserListByNick.end();)
33 - if (SGLine->Check(u) != NULL)
36 + // TODO: ADD SOME CODE
39 void SendAkillDel(const XLine*) { }
40 @@ -62,13 +57,16 @@ class ngIRCdProto : public IRCDProto
41 send_cmd(source ? source->nick : Config->ServerName, "WALLOPS :%s", buf.c_str());
44 - void SendJoin(BotInfo *user, Channel *c, const ChannelStatus *status)
45 + void SendJoin(User *user, Channel *c, const ChannelStatus *status)
47 send_cmd(user->nick, "JOIN %s", c->name.c_str());
50 + BotInfo *setter = findbot(user->nick);
51 for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i)
52 if (status->HasFlag(ModeManager::ChannelModes[i]->Name))
53 - c->SetMode(user, ModeManager::ChannelModes[i], user->nick, false);
54 + c->SetMode(setter, ModeManager::ChannelModes[i], user->nick, false);
58 void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf)
59 @@ -84,7 +82,7 @@ class ngIRCdProto : public IRCDProto
63 - send_cmd("", "PASS %s 0210-IRC+ Anope|%s:CLHSo P", uplink_server->password.c_str(), Anope::VersionShort().c_str());
64 + send_cmd("", "PASS %s 0210-IRC+ Anope|%s:CLHSo P", Config->Uplinks[CurrentUplink]->password.c_str(), Anope::VersionShort().c_str());
65 /* Make myself known to myself in the serverlist */
67 /* finish the enhanced server handshake and register the connection */
68 @@ -92,9 +90,11 @@ class ngIRCdProto : public IRCDProto
71 // Received: :dev.anope.de NICK DukeP 1 ~DukePyro p57ABF9C9.dip.t-dialin.net 1 +i :DukePyrolator
72 - void SendClientIntroduction(const User *u, const Anope::string &modes)
73 + void SendClientIntroduction(const User *u)
75 - EnforceQlinedNick(u->nick, "");
76 + Anope::string modes = "+" + u->GetModes();
77 + XLine x(u->nick, "Reserved for services");
78 + ircdproto->SendSQLine(NULL, &x);
79 send_cmd(Config->ServerName, "NICK %s 1 %s %s 1 %s :%s", u->nick.c_str(), u->GetIdent().c_str(), u->host.c_str(), modes.c_str(), u->realname.c_str());
82 @@ -126,7 +126,7 @@ class ngIRCdProto : public IRCDProto
84 void SendNoticeChanopsInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
86 - send_cmd(source ? source->nick : Config->s_ChanServ, "NOTICE @%s :%s", dest->name.c_str(), buf.c_str());
87 + send_cmd(source->nick, "NOTICE @%s :%s", dest->name.c_str(), buf.c_str());
91 @@ -196,8 +196,8 @@ class ngIRCdIRCdMessage : public IRCdMessage
93 // a new user is connecting to the network
94 User *user = do_nick("", params[0], params[2], params[3], source, params[6], Anope::CurTime, "", "", "", params[5]);
96 - validate_user(user);
97 + if (user && nickserv)
98 + nickserv->Validate(user);
102 @@ -433,7 +433,7 @@ class ProtongIRCd : public Module
103 ModeManager::AddUserMode(new UserMode(UMODE_CLOAK, 'x'));
106 - ModeManager::AddChannelMode(new ChannelModeBan(CMODE_BAN, 'b'));
107 + ModeManager::AddChannelMode(new ChannelModeList(CMODE_BAN, 'b'));
108 ModeManager::AddChannelMode(new ChannelModeList(CMODE_INVITEOVERRIDE, 'I'));
111 @@ -454,13 +454,12 @@ class ProtongIRCd : public Module
115 - ProtongIRCd(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator),
116 + ProtongIRCd(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL),
117 message_kick("KICK", event_kick), message_pass("PASS", event_pass),
118 message_njoin("NJOIN", event_njoin), message_chaninfo("CHANINFO", event_chaninfo),
119 message_005("005", event_005), message_442("442", event_442), message_376("376", event_376)
121 this->SetAuthor("Anope");
122 - this->SetType(PROTOCOL);
124 Capab.SetFlag(CAPAB_QS);