0003-Update-ngIRCd-protocol-module-for-current-Anope-1.9.patch 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. modules/protocol/ngircd.cpp | 37 ++++++++++++++++++-------------------
  8. 1 files changed, 18 insertions(+), 19 deletions(-)
  9. diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp
  10. index e546d05..790b8f4 100644
  11. --- a/modules/protocol/ngircd.cpp
  12. +++ b/modules/protocol/ngircd.cpp
  13. @@ -11,6 +11,8 @@
  14. #include "services.h"
  15. #include "modules.h"
  16. +#include "nickserv.h"
  17. +#include "oper.h"
  18. IRCDVar myIrcd[] = {
  19. {"ngIRCd", /* ircd name */
  20. @@ -45,14 +47,7 @@ class ngIRCdProto : public IRCDProto
  21. {
  22. void SendAkill(User *u, const XLine *x)
  23. {
  24. - if (SGLine && u == NULL)
  25. - for (Anope::insensitive_map<User *>::iterator it = UserListByNick.begin(); it != UserListByNick.end();)
  26. - {
  27. - u = it->second;
  28. - ++it;
  29. - if (SGLine->Check(u) != NULL)
  30. - break;
  31. - }
  32. + // TODO: ADD SOME CODE
  33. }
  34. void SendAkillDel(const XLine*) { }
  35. @@ -62,13 +57,16 @@ class ngIRCdProto : public IRCDProto
  36. send_cmd(source ? source->nick : Config->ServerName, "WALLOPS :%s", buf.c_str());
  37. }
  38. - void SendJoin(BotInfo *user, Channel *c, const ChannelStatus *status)
  39. + void SendJoin(User *user, Channel *c, const ChannelStatus *status)
  40. {
  41. send_cmd(user->nick, "JOIN %s", c->name.c_str());
  42. if (status)
  43. + {
  44. + BotInfo *setter = findbot(user->nick);
  45. for (unsigned i = 0; i < ModeManager::ChannelModes.size(); ++i)
  46. if (status->HasFlag(ModeManager::ChannelModes[i]->Name))
  47. - c->SetMode(user, ModeManager::ChannelModes[i], user->nick, false);
  48. + c->SetMode(setter, ModeManager::ChannelModes[i], user->nick, false);
  49. + }
  50. }
  51. void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf)
  52. @@ -84,7 +82,7 @@ class ngIRCdProto : public IRCDProto
  53. void SendConnect()
  54. {
  55. - send_cmd("", "PASS %s 0210-IRC+ Anope|%s:CLHSo P", uplink_server->password.c_str(), Anope::VersionShort().c_str());
  56. + send_cmd("", "PASS %s 0210-IRC+ Anope|%s:CLHSo P", Config->Uplinks[CurrentUplink]->password.c_str(), Anope::VersionShort().c_str());
  57. /* Make myself known to myself in the serverlist */
  58. SendServer(Me);
  59. /* finish the enhanced server handshake and register the connection */
  60. @@ -92,9 +90,11 @@ class ngIRCdProto : public IRCDProto
  61. }
  62. // Received: :dev.anope.de NICK DukeP 1 ~DukePyro p57ABF9C9.dip.t-dialin.net 1 +i :DukePyrolator
  63. - void SendClientIntroduction(const User *u, const Anope::string &modes)
  64. + void SendClientIntroduction(const User *u)
  65. {
  66. - EnforceQlinedNick(u->nick, "");
  67. + Anope::string modes = "+" + u->GetModes();
  68. + XLine x(u->nick, "Reserved for services");
  69. + ircdproto->SendSQLine(NULL, &x);
  70. 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());
  71. }
  72. @@ -126,7 +126,7 @@ class ngIRCdProto : public IRCDProto
  73. void SendNoticeChanopsInternal(const BotInfo *source, const Channel *dest, const Anope::string &buf)
  74. {
  75. - send_cmd(source ? source->nick : Config->s_ChanServ, "NOTICE @%s :%s", dest->name.c_str(), buf.c_str());
  76. + send_cmd(source->nick, "NOTICE @%s :%s", dest->name.c_str(), buf.c_str());
  77. }
  78. /* INVITE */
  79. @@ -196,8 +196,8 @@ class ngIRCdIRCdMessage : public IRCdMessage
  80. {
  81. // a new user is connecting to the network
  82. User *user = do_nick("", params[0], params[2], params[3], source, params[6], Anope::CurTime, "", "", "", params[5]);
  83. - if (user)
  84. - validate_user(user);
  85. + if (user && nickserv)
  86. + nickserv->Validate(user);
  87. }
  88. else
  89. {
  90. @@ -433,7 +433,7 @@ class ProtongIRCd : public Module
  91. ModeManager::AddUserMode(new UserMode(UMODE_CLOAK, 'x'));
  92. /* b/e/I */
  93. - ModeManager::AddChannelMode(new ChannelModeBan(CMODE_BAN, 'b'));
  94. + ModeManager::AddChannelMode(new ChannelModeList(CMODE_BAN, 'b'));
  95. ModeManager::AddChannelMode(new ChannelModeList(CMODE_INVITEOVERRIDE, 'I'));
  96. /* v/h/o/a/q */
  97. @@ -454,13 +454,12 @@ class ProtongIRCd : public Module
  98. }
  99. public:
  100. - ProtongIRCd(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator),
  101. + ProtongIRCd(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL),
  102. message_kick("KICK", event_kick), message_pass("PASS", event_pass),
  103. message_njoin("NJOIN", event_njoin), message_chaninfo("CHANINFO", event_chaninfo),
  104. message_005("005", event_005), message_442("442", event_442), message_376("376", event_376)
  105. {
  106. this->SetAuthor("Anope");
  107. - this->SetType(PROTOCOL);
  108. Capab.SetFlag(CAPAB_QS);
  109. --
  110. 1.7.8.3