]> arthur.barton.de Git - ngircd-alex.git/blob - contrib/Anope/0003-Update-ngIRCd-protocol-module-for-current-Anope.patch
Shorten filenames of Anope protocol module patchfiles
[ngircd-alex.git] / contrib / Anope / 0003-Update-ngIRCd-protocol-module-for-current-Anope.patch
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
5  GIT
6
7 ---
8  modules/protocol/ngircd.cpp |   37 ++++++++++++++++++-------------------
9  1 files changed, 18 insertions(+), 19 deletions(-)
10
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
15 @@ -11,6 +11,8 @@
16  
17  #include "services.h"
18  #include "modules.h"
19 +#include "nickserv.h"
20 +#include "oper.h"
21  
22  IRCDVar myIrcd[] = {
23         {"ngIRCd",      /* ircd name */
24 @@ -45,14 +47,7 @@ class ngIRCdProto : public IRCDProto
25  {
26         void SendAkill(User *u, const XLine *x)
27         {
28 -               if (SGLine && u == NULL)
29 -                       for (Anope::insensitive_map<User *>::iterator it = UserListByNick.begin(); it != UserListByNick.end();)
30 -                       {
31 -                               u = it->second;
32 -                               ++it;
33 -                               if (SGLine->Check(u) != NULL)
34 -                                       break;
35 -                       }
36 +               // TODO: ADD SOME CODE
37         }
38  
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());
42         }
43  
44 -       void SendJoin(BotInfo *user, Channel *c, const ChannelStatus *status)
45 +       void SendJoin(User *user, Channel *c, const ChannelStatus *status)
46         {
47                 send_cmd(user->nick, "JOIN %s", c->name.c_str());
48                 if (status)
49 +               {
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);
55 +               }
56         }
57  
58         void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf)
59 @@ -84,7 +82,7 @@ class ngIRCdProto : public IRCDProto
60  
61         void SendConnect()
62         {
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 */
66                 SendServer(Me);
67                 /* finish the enhanced server handshake and register the connection */
68 @@ -92,9 +90,11 @@ class ngIRCdProto : public IRCDProto
69         }
70  
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)
74         {
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());
80         }
81  
82 @@ -126,7 +126,7 @@ class ngIRCdProto : public IRCDProto
83  
84         void SendNoticeChanopsInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
85         {
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());
88         }
89  
90         /* INVITE */
91 @@ -196,8 +196,8 @@ class ngIRCdIRCdMessage : public IRCdMessage
92                 {
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]);
95 -                       if (user)
96 -                               validate_user(user);
97 +                       if (user && nickserv)
98 +                               nickserv->Validate(user);
99                 }
100                 else
101                 {
102 @@ -433,7 +433,7 @@ class ProtongIRCd : public Module
103                 ModeManager::AddUserMode(new UserMode(UMODE_CLOAK, 'x'));
104  
105                 /* b/e/I */
106 -               ModeManager::AddChannelMode(new ChannelModeBan(CMODE_BAN, 'b'));
107 +               ModeManager::AddChannelMode(new ChannelModeList(CMODE_BAN, 'b'));
108                 ModeManager::AddChannelMode(new ChannelModeList(CMODE_INVITEOVERRIDE, 'I'));
109  
110                 /* v/h/o/a/q */
111 @@ -454,13 +454,12 @@ class ProtongIRCd : public Module
112         }
113  
114   public:
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)
120         {
121                 this->SetAuthor("Anope");
122 -               this->SetType(PROTOCOL);
123  
124                 Capab.SetFlag(CAPAB_QS);
125  
126 -- 
127 1.7.8.3
128