Anope IRC Services  Version 2.0
inspircd20.cpp
Go to the documentation of this file.
1 /* Inspircd 2.0 functions
2  *
3  * (C) 2003-2014 Anope Team
4  * Contact us at team@anope.org
5  *
6  * Please read COPYING and README for further details.
7  *
8  * Based on the original code of Epona by Lara.
9  * Based on the original code of Services by Andy Church.
10  */
11 
12 #include "module.h"
13 #include "modules/cs_mode.h"
14 
15 static unsigned int spanningtree_proto_ver = 0;
16 
17 static ServiceReference<IRCDProto> insp12("IRCDProto", "inspircd12");
18 
19 class InspIRCd20Proto : public IRCDProto
20 {
21  public:
22  InspIRCd20Proto(Module *creator) : IRCDProto(creator, "InspIRCd 2.0")
23  {
25  CanSVSNick = true;
26  CanSVSJoin = true;
27  CanSetVHost = true;
28  CanSetVIdent = true;
29  CanSQLine = true;
30  CanSZLine = true;
31  CanSVSHold = true;
32  CanCertFP = true;
33  RequiresID = true;
34  MaxModes = 20;
35  }
36 
38  {
39  UplinkSocket::Message() << "CAPAB START 1202";
40  UplinkSocket::Message() << "CAPAB CAPABILITIES :PROTOCOL=1202";
41  UplinkSocket::Message() << "CAPAB END";
42  insp12->SendConnect();
43  }
44 
45  void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override { insp12->SendSVSKillInternal(source, user, buf); }
46  void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override { insp12->SendGlobalNotice(bi, dest, msg); }
47  void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override { insp12->SendGlobalPrivmsg(bi, dest, msg); }
48  void SendAkillDel(const XLine *x) anope_override { insp12->SendAkillDel(x); }
49  void SendTopic(const MessageSource &whosets, Channel *c) anope_override { insp12->SendTopic(whosets, c); };
50  void SendVhostDel(User *u) anope_override { insp12->SendVhostDel(u); }
51  void SendAkill(User *u, XLine *x) anope_override { insp12->SendAkill(u, x); }
52  void SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf) anope_override { insp12->SendNumericInternal(numeric, dest, buf); }
53  void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) anope_override { insp12->SendModeInternal(source, dest, buf); }
54  void SendClientIntroduction(User *u) anope_override { insp12->SendClientIntroduction(u); }
55  void SendServer(const Server *server) anope_override { insp12->SendServer(server); }
56  void SendSquit(Server *s, const Anope::string &message) anope_override { insp12->SendSquit(s, message); }
57  void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override { insp12->SendJoin(user, c, status); }
58  void SendSQLineDel(const XLine *x) anope_override { insp12->SendSQLineDel(x); }
59  void SendSQLine(User *u, const XLine *x) anope_override { insp12->SendSQLine(u, x); }
60  void SendVhost(User *u, const Anope::string &vident, const Anope::string &vhost) anope_override { insp12->SendVhost(u, vident, vhost); }
61  void SendSVSHold(const Anope::string &nick, time_t t) anope_override { insp12->SendSVSHold(nick, t); }
62  void SendSVSHoldDel(const Anope::string &nick) anope_override { insp12->SendSVSHoldDel(nick); }
63  void SendSZLineDel(const XLine *x) anope_override { insp12->SendSZLineDel(x); }
64  void SendSZLine(User *u, const XLine *x) anope_override { insp12->SendSZLine(u, x); }
65  void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &other) anope_override { insp12->SendSVSJoin(source, u, chan, other); }
66  void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &param) anope_override { insp12->SendSVSPart(source, u, chan, param); }
67  void SendSWhois(const MessageSource &bi, const Anope::string &who, const Anope::string &mask) anope_override { insp12->SendSWhois(bi, who, mask); }
68  void SendBOB() anope_override { insp12->SendBOB(); }
69  void SendEOB() anope_override { insp12->SendEOB(); }
70  void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) { insp12->SendGlobopsInternal(source, buf); }
71  void SendLogin(User *u, NickAlias *na) anope_override { insp12->SendLogin(u, na); }
72  void SendLogout(User *u) anope_override { insp12->SendLogout(u); }
73  void SendChannel(Channel *c) anope_override { insp12->SendChannel(c); }
74  void SendSASLMessage(const SASL::Message &message) anope_override { insp12->SendSASLMessage(message); }
75  void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) anope_override { insp12->SendSVSLogin(uid, acc); }
76  bool IsExtbanValid(const Anope::string &mask) anope_override { return insp12->IsExtbanValid(mask); }
77  bool IsIdentValid(const Anope::string &ident) anope_override { return insp12->IsIdentValid(ident); }
78 };
79 
80 class InspIRCdExtBan : public ChannelModeVirtual<ChannelModeList>
81 {
82  char ext;
83 
84  public:
85  InspIRCdExtBan(const Anope::string &mname, const Anope::string &basename, char extban) : ChannelModeVirtual<ChannelModeList>(mname, basename)
86  , ext(extban)
87  {
88  }
89 
91  {
92  param = Anope::string(ext) + ":" + param;
94  }
95 
97  {
98  if (cm->type != MODE_LIST || param.length() < 3 || param[0] != ext || param[1] != ':')
99  return cm;
100 
101  param = param.substr(2);
102  return this;
103  }
104 };
105 
106 namespace InspIRCdExtban
107 {
109  {
110  public:
111  EntryMatcher(const Anope::string &mname, const Anope::string &mbase, char c) : InspIRCdExtBan(mname, mbase, c)
112  {
113  }
114 
115  bool Matches(User *u, const Entry *e) anope_override
116  {
117  const Anope::string &mask = e->GetMask();
118  Anope::string real_mask = mask.substr(3);
119 
120  return Entry(this->name, real_mask).Matches(u);
121  }
122  };
123 
125  {
126  public:
127  ChannelMatcher(const Anope::string &mname, const Anope::string &mbase, char c) : InspIRCdExtBan(mname, mbase, c)
128  {
129  }
130 
131  bool Matches(User *u, const Entry *e) anope_override
132  {
133  const Anope::string &mask = e->GetMask();
134 
135  Anope::string channel = mask.substr(3);
136 
137  ChannelMode *cm = NULL;
138  if (channel[0] != '#')
139  {
140  char modeChar = ModeManager::GetStatusChar(channel[0]);
141  channel.erase(channel.begin());
142  cm = ModeManager::FindChannelModeByChar(modeChar);
143  if (cm != NULL && cm->type != MODE_STATUS)
144  cm = NULL;
145  }
146 
147  Channel *c = Channel::Find(channel);
148  if (c != NULL)
149  {
150  ChanUserContainer *uc = c->FindUser(u);
151  if (uc != NULL)
152  if (cm == NULL || uc->status.HasMode(cm->mchar))
153  return true;
154  }
155 
156  return false;
157  }
158  };
159 
161  {
162  public:
163  AccountMatcher(const Anope::string &mname, const Anope::string &mbase, char c) : InspIRCdExtBan(mname, mbase, c)
164  {
165  }
166 
167  bool Matches(User *u, const Entry *e) anope_override
168  {
169  const Anope::string &mask = e->GetMask();
170  Anope::string real_mask = mask.substr(2);
171 
172  return u->IsIdentified() && real_mask.equals_ci(u->Account()->display);
173  }
174  };
175 
177  {
178  public:
179  RealnameMatcher(const Anope::string &mname, const Anope::string &mbase, char c) : InspIRCdExtBan(mname, mbase, c)
180  {
181  }
182 
183  bool Matches(User *u, const Entry *e) anope_override
184  {
185  const Anope::string &mask = e->GetMask();
186  Anope::string real_mask = mask.substr(2);
187  return Anope::Match(u->realname, real_mask);
188  }
189  };
190 
192  {
193  public:
194  ServerMatcher(const Anope::string &mname, const Anope::string &mbase, char c) : InspIRCdExtBan(mname, mbase, c)
195  {
196  }
197 
198  bool Matches(User *u, const Entry *e) anope_override
199  {
200  const Anope::string &mask = e->GetMask();
201  Anope::string real_mask = mask.substr(2);
202  return Anope::Match(u->server->GetName(), real_mask);
203  }
204  };
205 
207  {
208  public:
209  FinerprintMatcher(const Anope::string &mname, const Anope::string &mbase, char c) : InspIRCdExtBan(mname, mbase, c)
210  {
211  }
212 
213  bool Matches(User *u, const Entry *e) anope_override
214  {
215  const Anope::string &mask = e->GetMask();
216  Anope::string real_mask = mask.substr(2);
217  return !u->fingerprint.empty() && Anope::Match(u->fingerprint, real_mask);
218  }
219  };
220 
222  {
223  public:
224  UnidentifiedMatcher(const Anope::string &mname, const Anope::string &mbase, char c) : InspIRCdExtBan(mname, mbase, c)
225  {
226  }
227 
228  bool Matches(User *u, const Entry *e) anope_override
229  {
230  const Anope::string &mask = e->GetMask();
231  Anope::string real_mask = mask.substr(2);
232  return !u->Account() && Entry("BAN", real_mask).Matches(u);
233  }
234  };
235 }
236 
238 {
239  public:
240  ColonDelimitedParamMode(const Anope::string &modename, char modeChar) : ChannelModeParam(modename, modeChar, true) { }
241 
243  {
244  return IsValid(value, false);
245  }
246 
247  bool IsValid(const Anope::string &value, bool historymode) const
248  {
249  if (value.empty())
250  return false; // empty param is never valid
251 
252  Anope::string::size_type pos = value.find(':');
253  if ((pos == Anope::string::npos) || (pos == 0))
254  return false; // no ':' or it's the first char, both are invalid
255 
256  Anope::string rest;
257  try
258  {
259  if (convertTo<int>(value, rest, false) <= 0)
260  return false; // negative numbers and zero are invalid
261 
262  rest = rest.substr(1);
263  int n;
264  if (historymode)
265  {
266  // For the history mode, the part after the ':' is a duration and it
267  // can be in the user friendly "1d3h20m" format, make sure we accept that
268  n = Anope::DoTime(rest);
269  }
270  else
271  n = convertTo<int>(rest);
272 
273  if (n <= 0)
274  return false;
275  }
276  catch (const ConvertException &e)
277  {
278  // conversion error, invalid
279  return false;
280  }
281 
282  return true;
283  }
284 };
285 
287 {
288  public:
289  SimpleNumberParamMode(const Anope::string &modename, char modeChar) : ChannelModeParam(modename, modeChar, true) { }
290 
292  {
293  if (value.empty())
294  return false; // empty param is never valid
295 
296  try
297  {
298  if (convertTo<int>(value) <= 0)
299  return false;
300  }
301  catch (const ConvertException &e)
302  {
303  // conversion error, invalid
304  return false;
305  }
306 
307  return true;
308  }
309 };
310 
312 {
313  public:
314  ChannelModeFlood(char modeChar) : ColonDelimitedParamMode("FLOOD", modeChar) { }
315 
317  {
318  // The parameter of this mode is a bit different, it may begin with a '*',
319  // ignore it if that's the case
320  Anope::string v = value[0] == '*' ? value.substr(1) : value;
321  return ((!value.empty()) && (ColonDelimitedParamMode::IsValid(v)));
322  }
323 };
324 
326 {
327  public:
328  ChannelModeHistory(char modeChar) : ColonDelimitedParamMode("HISTORY", modeChar) { }
329 
331  {
332  return (ColonDelimitedParamMode::IsValid(value, true));
333  }
334 };
335 
337 {
338  public:
339  ChannelModeRedirect(char modeChar) : ChannelModeParam("REDIRECT", modeChar, true) { }
340 
342  {
343  // The parameter of this mode is a channel, and channel names start with '#'
344  return ((!value.empty()) && (value[0] == '#'));
345  }
346 };
347 
349 {
350  std::map<char, Anope::string> chmodes, umodes;
351 
352  IRCDMessageCapab(Module *creator) : Message::Capab(creator, "CAPAB") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
353 
354  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
355  {
356  if (params[0].equals_cs("START"))
357  {
358  if (params.size() >= 2)
359  spanningtree_proto_ver = (Anope::string(params[1]).is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0);
360 
361  if (spanningtree_proto_ver < 1202)
362  {
363  UplinkSocket::Message() << "ERROR :Protocol mismatch, no or invalid protocol version given in CAPAB START";
364  Anope::QuitReason = "Protocol mismatch, no or invalid protocol version given in CAPAB START";
365  Anope::Quitting = true;
366  return;
367  }
368 
369  /* reset CAPAB */
370  chmodes.clear();
371  umodes.clear();
372  Servers::Capab.insert("SERVERS");
373  Servers::Capab.insert("CHGHOST");
374  Servers::Capab.insert("CHGIDENT");
375  Servers::Capab.insert("TOPICLOCK");
376  IRCD->CanSVSHold = false;
377  }
378  else if (params[0].equals_cs("CHANMODES") && params.size() > 1)
379  {
380  spacesepstream ssep(params[1]);
381  Anope::string capab;
382 
383  while (ssep.GetToken(capab))
384  {
385  Anope::string modename = capab.substr(0, capab.find('='));
386  Anope::string modechar = capab.substr(capab.find('=') + 1);
387  ChannelMode *cm = NULL;
388 
389  if (modename.equals_cs("admin"))
390  cm = new ChannelModeStatus("PROTECT", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0, 3);
391  else if (modename.equals_cs("allowinvite"))
392  {
393  cm = new ChannelMode("ALLINVITE", modechar[0]);
394  ModeManager::AddChannelMode(new InspIRCdExtban::EntryMatcher("INVITEBAN", "BAN", 'A'));
395  }
396  else if (modename.equals_cs("auditorium"))
397  cm = new ChannelMode("AUDITORIUM", modechar[0]);
398  else if (modename.equals_cs("ban"))
399  cm = new ChannelModeList("BAN", modechar[0]);
400  else if (modename.equals_cs("banexception"))
401  cm = new ChannelModeList("EXCEPT", modechar[0]);
402  else if (modename.equals_cs("blockcaps"))
403  {
404  cm = new ChannelMode("BLOCKCAPS", modechar[0]);
405  ModeManager::AddChannelMode(new InspIRCdExtban::EntryMatcher("BLOCKCAPSBAN", "BAN", 'B'));
406  }
407  else if (modename.equals_cs("blockcolor"))
408  {
409  cm = new ChannelMode("BLOCKCOLOR", modechar[0]);
410  ModeManager::AddChannelMode(new InspIRCdExtban::EntryMatcher("BLOCKCOLORBAN", "BAN", 'c'));
411  }
412  else if (modename.equals_cs("c_registered"))
413  cm = new ChannelModeNoone("REGISTERED", modechar[0]);
414  else if (modename.equals_cs("censor"))
415  cm = new ChannelMode("CENSOR", modechar[0]);
416  else if (modename.equals_cs("delayjoin"))
417  cm = new ChannelMode("DELAYEDJOIN", modechar[0]);
418  else if (modename.equals_cs("delaymsg"))
419  cm = new SimpleNumberParamMode("DELAYMSG", modechar[0]);
420  else if (modename.equals_cs("filter"))
421  cm = new ChannelModeList("FILTER", modechar[0]);
422  else if (modename.equals_cs("flood"))
423  cm = new ChannelModeFlood(modechar[0]);
424  else if (modename.equals_cs("founder"))
425  cm = new ChannelModeStatus("OWNER", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0, 4);
426  else if (modename.equals_cs("halfop"))
427  cm = new ChannelModeStatus("HALFOP", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0, 1);
428  else if (modename.equals_cs("history"))
429  cm = new ChannelModeHistory(modechar[0]);
430  else if (modename.equals_cs("invex"))
431  cm = new ChannelModeList("INVITEOVERRIDE", modechar[0]);
432  else if (modename.equals_cs("inviteonly"))
433  cm = new ChannelMode("INVITE", modechar[0]);
434  else if (modename.equals_cs("joinflood"))
435  cm = new ColonDelimitedParamMode("JOINFLOOD", modechar[0]);
436  else if (modename.equals_cs("key"))
437  cm = new ChannelModeKey(modechar[0]);
438  else if (modename.equals_cs("kicknorejoin"))
439  cm = new SimpleNumberParamMode("NOREJOIN", modechar[0]);
440  else if (modename.equals_cs("limit"))
441  cm = new ChannelModeParam("LIMIT", modechar[0], true);
442  else if (modename.equals_cs("moderated"))
443  cm = new ChannelMode("MODERATED", modechar[0]);
444  else if (modename.equals_cs("nickflood"))
445  cm = new ColonDelimitedParamMode("NICKFLOOD", modechar[0]);
446  else if (modename.equals_cs("noctcp"))
447  {
448  cm = new ChannelMode("NOCTCP", modechar[0]);
449  ModeManager::AddChannelMode(new InspIRCdExtban::EntryMatcher("NOCTCPBAN", "BAN", 'C'));
450  }
451  else if (modename.equals_cs("noextmsg"))
452  cm = new ChannelMode("NOEXTERNAL", modechar[0]);
453  else if (modename.equals_cs("nokick"))
454  {
455  cm = new ChannelMode("NOKICK", modechar[0]);
456  ModeManager::AddChannelMode(new InspIRCdExtban::EntryMatcher("NOKICKBAN", "BAN", 'Q'));
457  }
458  else if (modename.equals_cs("noknock"))
459  cm = new ChannelMode("NOKNOCK", modechar[0]);
460  else if (modename.equals_cs("nonick"))
461  {
462  cm = new ChannelMode("NONICK", modechar[0]);
463  ModeManager::AddChannelMode(new InspIRCdExtban::EntryMatcher("NONICKBAN", "BAN", 'N'));
464  }
465  else if (modename.equals_cs("nonotice"))
466  {
467  cm = new ChannelMode("NONOTICE", modechar[0]);
468  ModeManager::AddChannelMode(new InspIRCdExtban::EntryMatcher("NONOTICEBAN", "BAN", 'T'));
469  }
470  else if (modename.equals_cs("op"))
471  cm = new ChannelModeStatus("OP", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0, 2);
472  else if (modename.equals_cs("operonly"))
473  cm = new ChannelModeOperOnly("OPERONLY", modechar[0]);
474  else if (modename.equals_cs("permanent"))
475  cm = new ChannelMode("PERM", modechar[0]);
476  else if (modename.equals_cs("private"))
477  cm = new ChannelMode("PRIVATE", modechar[0]);
478  else if (modename.equals_cs("redirect"))
479  cm = new ChannelModeRedirect(modechar[0]);
480  else if (modename.equals_cs("reginvite"))
481  cm = new ChannelMode("REGISTEREDONLY", modechar[0]);
482  else if (modename.equals_cs("regmoderated"))
483  cm = new ChannelMode("REGMODERATED", modechar[0]);
484  else if (modename.equals_cs("secret"))
485  cm = new ChannelMode("SECRET", modechar[0]);
486  else if (modename.equals_cs("sslonly"))
487  {
488  cm = new ChannelMode("SSL", modechar[0]);
490  }
491  else if (modename.equals_cs("stripcolor"))
492  {
493  cm = new ChannelMode("STRIPCOLOR", modechar[0]);
494  ModeManager::AddChannelMode(new InspIRCdExtban::EntryMatcher("STRIPCOLORBAN", "BAN", 'S'));
495  }
496  else if (modename.equals_cs("topiclock"))
497  cm = new ChannelMode("TOPIC", modechar[0]);
498  else if (modename.equals_cs("voice"))
499  cm = new ChannelModeStatus("VOICE", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0, 0);
500  /* Unknown status mode, (customprefix) - add it */
501  else if (modechar.length() == 2)
502  cm = new ChannelModeStatus(modename.upper(), modechar[1], modechar[0], -1);
503  /* Unknown non status mode, add it to our list for later */
504  else
505  chmodes[modechar[0]] = modename.upper();
506 
507  if (cm)
509  }
510  }
511  if (params[0].equals_cs("USERMODES") && params.size() > 1)
512  {
513  spacesepstream ssep(params[1]);
514  Anope::string capab;
515 
516  while (ssep.GetToken(capab))
517  {
518  Anope::string modename = capab.substr(0, capab.find('='));
519  Anope::string modechar = capab.substr(capab.find('=') + 1);
520  UserMode *um = NULL;
521 
522  if (modename.equals_cs("bot"))
523  um = new UserMode("BOT", modechar[0]);
524  else if (modename.equals_cs("callerid"))
525  um = new UserMode("CALLERID", modechar[0]);
526  else if (modename.equals_cs("cloak"))
527  um = new UserMode("CLOAK", modechar[0]);
528  else if (modename.equals_cs("deaf"))
529  um = new UserMode("DEAF", modechar[0]);
530  else if (modename.equals_cs("deaf_commonchan"))
531  um = new UserMode("COMMONCHANS", modechar[0]);
532  else if (modename.equals_cs("helpop"))
533  um = new UserModeOperOnly("HELPOP", modechar[0]);
534  else if (modename.equals_cs("hidechans"))
535  um = new UserMode("PRIV", modechar[0]);
536  else if (modename.equals_cs("hideoper"))
537  um = new UserModeOperOnly("HIDEOPER", modechar[0]);
538  else if (modename.equals_cs("invisible"))
539  um = new UserMode("INVIS", modechar[0]);
540  else if (modename.equals_cs("invis-oper"))
541  um = new UserModeOperOnly("INVISIBLE_OPER", modechar[0]);
542  else if (modename.equals_cs("oper"))
543  um = new UserModeOperOnly("OPER", modechar[0]);
544  else if (modename.equals_cs("regdeaf"))
545  um = new UserMode("REGPRIV", modechar[0]);
546  else if (modename.equals_cs("servprotect"))
547  {
548  um = new UserModeNoone("PROTECTED", modechar[0]);
549  IRCD->DefaultPseudoclientModes += modechar;
550  }
551  else if (modename.equals_cs("showwhois"))
552  um = new UserMode("WHOIS", modechar[0]);
553  else if (modename.equals_cs("u_censor"))
554  um = new UserMode("CENSOR", modechar[0]);
555  else if (modename.equals_cs("u_registered"))
556  um = new UserModeNoone("REGISTERED", modechar[0]);
557  else if (modename.equals_cs("u_stripcolor"))
558  um = new UserMode("STRIPCOLOR", modechar[0]);
559  else if (modename.equals_cs("wallops"))
560  um = new UserMode("WALLOPS", modechar[0]);
561  else
562  umodes[modechar[0]] = modename.upper();
563 
564  if (um)
566  }
567  }
568  else if (params[0].equals_cs("MODULES") && params.size() > 1)
569  {
570  spacesepstream ssep(params[1]);
571  Anope::string module;
572 
573  while (ssep.GetToken(module))
574  {
575  if (module.equals_cs("m_svshold.so"))
576  IRCD->CanSVSHold = true;
577  else if (module.find("m_rline.so") == 0)
578  {
579  Servers::Capab.insert("RLINE");
580  const Anope::string &regexengine = Config->GetBlock("options")->Get<const Anope::string>("regexengine");
581  if (!regexengine.empty() && module.length() > 11 && regexengine != module.substr(11))
582  Log() << "Warning: InspIRCd is using regex engine " << module.substr(11) << ", but we have " << regexengine << ". This may cause inconsistencies.";
583  }
584  else if (module.equals_cs("m_topiclock.so"))
585  Servers::Capab.insert("TOPICLOCK");
586  }
587  }
588  else if (params[0].equals_cs("MODSUPPORT") && params.size() > 1)
589  {
590  spacesepstream ssep(params[1]);
591  Anope::string module;
592 
593  while (ssep.GetToken(module))
594  {
595  if (module.equals_cs("m_services_account.so"))
596  {
597  Servers::Capab.insert("SERVICES");
598  ModeManager::AddChannelMode(new InspIRCdExtban::AccountMatcher("ACCOUNTBAN", "BAN", 'R'));
599  ModeManager::AddChannelMode(new InspIRCdExtban::UnidentifiedMatcher("UNREGISTEREDBAN", "BAN", 'U'));
600  }
601  else if (module.equals_cs("m_chghost.so"))
602  Servers::Capab.insert("CHGHOST");
603  else if (module.equals_cs("m_chgident.so"))
604  Servers::Capab.insert("CHGIDENT");
605  else if (module == "m_channelban.so")
606  ModeManager::AddChannelMode(new InspIRCdExtban::ChannelMatcher("CHANNELBAN", "BAN", 'j'));
607  else if (module == "m_gecosban.so")
608  ModeManager::AddChannelMode(new InspIRCdExtban::RealnameMatcher("REALNAMEBAN", "BAN", 'r'));
609  else if (module == "m_nopartmessage.so")
610  ModeManager::AddChannelMode(new InspIRCdExtban::EntryMatcher("PARTMESSAGEBAN", "BAN", 'p'));
611  else if (module == "m_serverban.so")
612  ModeManager::AddChannelMode(new InspIRCdExtban::ServerMatcher("SERVERBAN", "BAN", 's'));
613  else if (module == "m_muteban.so")
615  }
616  }
617  else if (params[0].equals_cs("CAPABILITIES") && params.size() > 1)
618  {
619  spacesepstream ssep(params[1]);
620  Anope::string capab;
621  while (ssep.GetToken(capab))
622  {
623  if (capab.find("CHANMODES") != Anope::string::npos)
624  {
625  Anope::string modes(capab.begin() + 10, capab.end());
626  commasepstream sep(modes);
627  Anope::string modebuf;
628 
629  sep.GetToken(modebuf);
630  for (size_t t = 0, end = modebuf.length(); t < end; ++t)
631  {
632  if (ModeManager::FindChannelModeByChar(modebuf[t]))
633  continue;
634  ModeManager::AddChannelMode(new ChannelModeList(chmodes[modebuf[t]], modebuf[t]));
635  }
636 
637  sep.GetToken(modebuf);
638  for (size_t t = 0, end = modebuf.length(); t < end; ++t)
639  {
640  if (ModeManager::FindChannelModeByChar(modebuf[t]))
641  continue;
642  ModeManager::AddChannelMode(new ChannelModeParam(chmodes[modebuf[t]], modebuf[t]));
643  }
644 
645  sep.GetToken(modebuf);
646  for (size_t t = 0, end = modebuf.length(); t < end; ++t)
647  {
648  if (ModeManager::FindChannelModeByChar(modebuf[t]))
649  continue;
650  ModeManager::AddChannelMode(new ChannelModeParam(chmodes[modebuf[t]], modebuf[t], true));
651  }
652 
653  sep.GetToken(modebuf);
654  for (size_t t = 0, end = modebuf.length(); t < end; ++t)
655  {
656  if (ModeManager::FindChannelModeByChar(modebuf[t]))
657  continue;
658  ModeManager::AddChannelMode(new ChannelMode(chmodes[modebuf[t]], modebuf[t]));
659  }
660  }
661  else if (capab.find("USERMODES") != Anope::string::npos)
662  {
663  Anope::string modes(capab.begin() + 10, capab.end());
664  commasepstream sep(modes);
665  Anope::string modebuf;
666 
667  sep.GetToken(modebuf);
668  sep.GetToken(modebuf);
669 
670  if (sep.GetToken(modebuf))
671  for (size_t t = 0, end = modebuf.length(); t < end; ++t)
672  ModeManager::AddUserMode(new UserModeParam(umodes[modebuf[t]], modebuf[t]));
673 
674  if (sep.GetToken(modebuf))
675  for (size_t t = 0, end = modebuf.length(); t < end; ++t)
676  ModeManager::AddUserMode(new UserMode(umodes[modebuf[t]], modebuf[t]));
677  }
678  else if (capab.find("MAXMODES=") != Anope::string::npos)
679  {
680  Anope::string maxmodes(capab.begin() + 9, capab.end());
681  IRCD->MaxModes = maxmodes.is_pos_number_only() ? convertTo<unsigned>(maxmodes) : 3;
682  }
683  else if (capab.find("PREFIX=") != Anope::string::npos)
684  {
685  Anope::string modes(capab.begin() + 8, capab.begin() + capab.find(')'));
686  Anope::string chars(capab.begin() + capab.find(')') + 1, capab.end());
687  short level = modes.length() - 1;
688 
689  for (size_t t = 0, end = modes.length(); t < end; ++t)
690  {
692  if (cm == NULL || cm->type != MODE_STATUS)
693  {
694  Log() << "CAPAB PREFIX gave unknown channel status mode " << modes[t];
695  continue;
696  }
697 
699  cms->level = level--;
700 
701  Log(LOG_DEBUG) << cms->name << " is now level " << cms->level;
702  }
703 
705  }
706  else if (capab == "GLOBOPS=1")
707  Servers::Capab.insert("GLOBOPS");
708  }
709  }
710  else if (params[0].equals_cs("END"))
711  {
712  if (!Servers::Capab.count("SERVICES"))
713  {
714  UplinkSocket::Message() << "ERROR :m_services_account.so is not loaded. This is required by Anope";
715  Anope::QuitReason = "ERROR: Remote server does not have the m_services_account module loaded, and this is required.";
716  Anope::Quitting = true;
717  return;
718  }
719  if (!ModeManager::FindUserModeByName("PRIV"))
720  {
721  UplinkSocket::Message() << "ERROR :m_hidechans.so is not loaded. This is required by Anope";
722  Anope::QuitReason = "ERROR: Remote server does not have the m_hidechans module loaded, and this is required.";
723  Anope::Quitting = true;
724  return;
725  }
726  if (!IRCD->CanSVSHold)
727  Log() << "SVSHOLD missing, Usage disabled until module is loaded.";
728  if (!Servers::Capab.count("CHGHOST"))
729  Log() << "CHGHOST missing, Usage disabled until module is loaded.";
730  if (!Servers::Capab.count("CHGIDENT"))
731  Log() << "CHGIDENT missing, Usage disabled until module is loaded.";
732 
733  chmodes.clear();
734  umodes.clear();
735  }
736 
737  Message::Capab::Run(source, params);
738  }
739 };
740 
742 {
744 
745  IRCDMessageEncap(Module *creator) : IRCDMessage(creator, "ENCAP", 4), insp12_encap("IRCDMessage", "inspircd12/encap") { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
746 
747  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
748  {
749  if (Anope::Match(Me->GetSID(), params[0]) == false)
750  return;
751 
752  if (params[1] == "CHGIDENT")
753  {
754  User *u = User::Find(params[2]);
755  if (!u || u->server != Me)
756  return;
757 
758  u->SetIdent(params[3]);
759  UplinkSocket::Message(u) << "FIDENT " << params[3];
760  }
761  else if (params[1] == "CHGHOST")
762  {
763  User *u = User::Find(params[2]);
764  if (!u || u->server != Me)
765  return;
766 
767  u->SetDisplayedHost(params[3]);
768  UplinkSocket::Message(u) << "FHOST " << params[3];
769  }
770  else if (params[1] == "CHGNAME")
771  {
772  User *u = User::Find(params[2]);
773  if (!u || u->server != Me)
774  return;
775 
776  u->SetRealname(params[3]);
777  UplinkSocket::Message(u) << "FNAME " << params[3];
778  }
779 
780  if (insp12_encap)
781  insp12_encap->Run(source, params);
782  }
783 };
784 
786 {
787  IRCDMessageFIdent(Module *creator) : IRCDMessage(creator, "FIDENT", 1) { SetFlag(IRCDMESSAGE_REQUIRE_USER); }
788 
789  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
790  {
791  source.GetUser()->SetIdent(params[0]);
792  }
793 };
794 
795 class ProtoInspIRCd20 : public Module
796 {
798 
800 
801  /* Core message handlers */
816 
817  /* InspIRCd 1.2 message handlers */
822 
823  /* Our message handlers */
827 
829 
830  void SendChannelMetadata(Channel *c, const Anope::string &metadataname, const Anope::string &value)
831  {
832  UplinkSocket::Message(Me) << "METADATA " << c->name << " " << metadataname << " :" << value;
833  }
834 
835  public:
836  ProtoInspIRCd20(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
837  ircd_proto(this),
838  message_away(this), message_error(this), message_invite(this), message_join(this), message_kick(this),
839  message_kill(this), message_motd(this), message_notice(this), message_part(this), message_ping(this),
840  message_privmsg(this), message_quit(this), message_stats(this), message_topic(this),
841 
842  message_endburst("IRCDMessage", "inspircd20/endburst", "inspircd12/endburst"),
843  message_fhost("IRCDMessage", "inspircd20/fhost", "inspircd12/fhost"),
844  message_fjoin("IRCDMessage", "inspircd20/fjoin", "inspircd12/fjoin"),
845  message_fmode("IRCDMessage", "inspircd20/fmode", "inspircd12/fmode"),
846  message_ftopic("IRCDMessage", "inspircd20/ftopic", "inspircd12/ftopic"),
847  message_idle("IRCDMessage", "inspircd20/idle", "inspircd12/idle"),
848  message_metadata("IRCDMessage", "inspircd20/metadata", "inspircd12/metadata"),
849  message_mode("IRCDMessage", "inspircd20/mode", "inspircd12/mode"),
850  message_nick("IRCDMessage", "inspircd20/nick", "inspircd12/nick"),
851  message_opertype("IRCDMessage", "inspircd20/opertype", "inspircd12/opertype"),
852  message_rsquit("IRCDMessage", "inspircd20/rsquit", "inspircd12/rsquit"),
853  message_server("IRCDMessage", "inspircd20/server", "inspircd12/server"),
854  message_squit("IRCDMessage", "inspircd20/squit", "inspircd12/squit"),
855  message_time("IRCDMessage", "inspircd20/time", "inspircd12/time"),
856  message_uid("IRCDMessage", "inspircd20/uid", "inspircd12/uid"),
857 
858  message_capab(this), message_encap(this), message_fident(this)
859  {
860 
861  if (ModuleManager::LoadModule("inspircd12", User::Find(creator)) != MOD_ERR_OK)
862  throw ModuleException("Unable to load inspircd12");
863  m_insp12 = ModuleManager::FindModule("inspircd12");
864  if (!m_insp12)
865  throw ModuleException("Unable to find inspircd12");
866  if (!insp12)
867  throw ModuleException("No protocol interface for insp12");
868  ModuleManager::DetachAll(m_insp12);
869 
870  }
871 
873  {
874  m_insp12 = ModuleManager::FindModule("inspircd12");
875  ModuleManager::UnloadModule(m_insp12, NULL);
876  }
877 
879  {
880  use_server_side_topiclock = conf->GetModule(this)->Get<bool>("use_server_side_topiclock");
881  use_server_side_mlock = conf->GetModule(this)->Get<bool>("use_server_side_mlock");
882  }
883 
885  {
887  }
888 
890  {
891  if (c->ci)
892  this->OnChanRegistered(c->ci);
893  }
894 
896  {
897  ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
898  if (use_server_side_mlock && ci->c && modelocks && !modelocks->GetMLockAsString(false).empty())
899  {
900  Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "");
901  SendChannelMetadata(ci->c, "mlock", modes);
902  }
903 
904  if (use_server_side_topiclock && Servers::Capab.count("TOPICLOCK") && ci->c)
905  {
906  if (ci->HasExt("TOPICLOCK"))
907  SendChannelMetadata(ci->c, "topiclock", "1");
908  }
909  }
910 
912  {
913  if (use_server_side_mlock && ci->c)
914  SendChannelMetadata(ci->c, "mlock", "");
915 
916  if (use_server_side_topiclock && Servers::Capab.count("TOPICLOCK") && ci->c)
917  SendChannelMetadata(ci->c, "topiclock", "");
918  }
919 
921  {
922  ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
924  if (use_server_side_mlock && cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM))
925  {
926  Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "") + cm->mchar;
927  SendChannelMetadata(ci->c, "mlock", modes);
928  }
929 
930  return EVENT_CONTINUE;
931  }
932 
934  {
935  ModeLocks *modelocks = ci->GetExt<ModeLocks>("modelocks");
937  if (use_server_side_mlock && cm && ci->c && modelocks && (cm->type == MODE_REGULAR || cm->type == MODE_PARAM))
938  {
939  Anope::string modes = modelocks->GetMLockAsString(false).replace_all_cs("+", "").replace_all_cs("-", "").replace_all_cs(cm->mchar, "");
940  SendChannelMetadata(ci->c, "mlock", modes);
941  }
942 
943  return EVENT_CONTINUE;
944  }
945 
947  {
948  if (cmd->name == "chanserv/topic" && ci->c)
949  {
950  if (setting == "topiclock on")
951  SendChannelMetadata(ci->c, "topiclock", "1");
952  else if (setting == "topiclock off")
953  SendChannelMetadata(ci->c, "topiclock", "0");
954  }
955 
956  return EVENT_CONTINUE;
957  }
958 
960  {
961  if ((setter.GetUser() && setter.GetUser()->server == Me) || setter.GetServer() == Me || !setter.GetServer())
962  if (mode->name == "OPERPREFIX")
963  c->SetMode(c->ci->WhoSends(), mode, param, false);
964 
965  return EVENT_CONTINUE;
966  }
967 };
968 
Definition: bots.h:24
bool Matches(User *u, const Entry *e) anope_override
Definition: inspircd20.cpp:198
bool CanSZLine
Definition: protocol.h:61
void SendTopic(const MessageSource &whosets, Channel *c) anope_override
Definition: inspircd20.cpp:49
IRCDMessageEncap message_encap
Definition: inspircd20.cpp:825
Definition: servers.h:42
void SendConnect() anope_override
Definition: inspircd20.cpp:37
bool equals_cs(const char *_str) const
Definition: anope.h:74
AccountMatcher(const Anope::string &mname, const Anope::string &mbase, char c)
Definition: inspircd20.cpp:163
EventReturn OnMLock(ChannelInfo *ci, ModeLock *lock) anope_override
Definition: inspircd20.cpp:920
Module * m_insp12
Definition: inspircd20.cpp:797
bool use_server_side_mlock
Definition: inspircd20.cpp:828
static Module * FindModule(const Anope::string &name)
UnidentifiedMatcher(const Anope::string &mname, const Anope::string &mbase, char c)
Definition: inspircd20.cpp:224
bool IsValid(Anope::string &value) const anope_override
Definition: inspircd20.cpp:242
void SendSVSPart(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &param) anope_override
Definition: inspircd20.cpp:66
static ChannelMode * FindChannelModeByName(const Anope::string &name)
Definition: modes.cpp:542
bool Matches(User *u, bool full=false) const
Definition: modes.cpp:830
Message::Invite message_invite
Definition: inspircd20.cpp:804
Definition: hashcomp.h:84
void OnChanRegistered(ChannelInfo *ci) anope_override
Definition: inspircd20.cpp:895
ColonDelimitedParamMode(const Anope::string &modename, char modeChar)
Definition: inspircd20.cpp:240
bool Matches(User *u, const Entry *e) anope_override
Definition: inspircd20.cpp:131
ChannelMatcher(const Anope::string &mname, const Anope::string &mbase, char c)
Definition: inspircd20.cpp:127
void RemoveModeInternal(const MessageSource &setter, UserMode *um)
Definition: users.cpp:554
std::string::size_type size_type
Definition: anope.h:43
bool is_pos_number_only() const
Definition: anope.h:218
void SendSVSLogin(const Anope::string &uid, const Anope::string &acc) anope_override
Definition: inspircd20.cpp:75
void SendSVSHoldDel(const Anope::string &nick) anope_override
Definition: inspircd20.cpp:62
InspIRCd20Proto(Module *creator)
Definition: inspircd20.cpp:22
ChannelModeHistory(char modeChar)
Definition: inspircd20.cpp:328
Message::Topic message_topic
Definition: inspircd20.cpp:815
void SendSZLineDel(const XLine *x) anope_override
Definition: inspircd20.cpp:63
void SendVhost(User *u, const Anope::string &vident, const Anope::string &vhost) anope_override
Definition: inspircd20.cpp:60
CoreExport std::set< Anope::string > Capab
Definition: servers.cpp:29
void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override
Definition: inspircd20.cpp:46
std::map< char, Anope::string > umodes
Definition: inspircd20.cpp:350
static ModuleReturn UnloadModule(Module *m, User *u)
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: inspircd20.cpp:747
const Anope::string & GetSID() const
Definition: servers.cpp:203
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: inspircd20.cpp:789
static void RebuildStatusModes()
Definition: modes.cpp:594
bool IsValid(Anope::string &value) const anope_override
Definition: inspircd20.cpp:291
EntryMatcher(const Anope::string &mname, const Anope::string &mbase, char c)
Definition: inspircd20.cpp:111
Message::Kill message_kill
Definition: inspircd20.cpp:807
InspIRCd20Proto ircd_proto
Definition: inspircd20.cpp:799
Capab(Module *creator, const Anope::string &mname="CAPAB")
Definition: messages.h:32
Definition: users.h:34
void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override
Definition: inspircd20.cpp:57
void SendLogin(User *u, NickAlias *na) anope_override
Definition: inspircd20.cpp:71
ServiceAlias message_server
Definition: inspircd20.cpp:818
ServiceAlias message_rsquit
Definition: inspircd20.cpp:818
Anope::string DefaultPseudoclientModes
Definition: protocol.h:47
void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override
Definition: inspircd20.cpp:47
string upper() const
Definition: anope.h:266
void SendServer(const Server *server) anope_override
Definition: inspircd20.cpp:55
ServiceAlias message_fmode
Definition: inspircd20.cpp:818
void SendSQLineDel(const XLine *x) anope_override
Definition: inspircd20.cpp:58
bool CanSetVHost
Definition: protocol.h:53
bool IsExtbanValid(const Anope::string &mask) anope_override
Definition: inspircd20.cpp:76
bool equals_ci(const char *_str) const
Definition: anope.h:78
void SendEOB() anope_override
Definition: inspircd20.cpp:69
IRCDMessageFIdent(Module *creator)
Definition: inspircd20.cpp:787
bool HasMode(char c) const
Definition: modes.cpp:81
bool RequiresID
Definition: protocol.h:69
static UserMode * FindUserModeByName(const Anope::string &name)
Definition: modes.cpp:550
ServiceAlias message_time
Definition: inspircd20.cpp:818
Anope::string name
Definition: channels.h:44
void SendNumericInternal(int numeric, const Anope::string &dest, const Anope::string &buf) anope_override
Definition: inspircd20.cpp:52
bool IsValid(const Anope::string &value, bool historymode) const
Definition: inspircd20.cpp:247
ServiceAlias message_metadata
Definition: inspircd20.cpp:818
ProtoInspIRCd20(const Anope::string &modname, const Anope::string &creator)
Definition: inspircd20.cpp:836
void SendAkill(User *u, XLine *x) anope_override
Definition: inspircd20.cpp:51
void OnChannelSync(Channel *c) anope_override
Definition: inspircd20.cpp:889
Message::Kick message_kick
Definition: inspircd20.cpp:806
void OnUserNickChange(User *u, const Anope::string &) anope_override
Definition: inspircd20.cpp:884
iterator erase(const iterator &i)
Definition: anope.h:155
EventReturn OnSetChannelOption(CommandSource &source, Command *cmd, ChannelInfo *ci, const Anope::string &setting) anope_override
Definition: inspircd20.cpp:946
string substr(size_type pos=0, size_type n=npos) const
Definition: anope.h:277
virtual Anope::string GetMLockAsString(bool complete) const =0
bool CanSetVIdent
Definition: protocol.h:53
size_type length() const
Definition: anope.h:131
IRCDMessageCapab message_capab
Definition: inspircd20.cpp:824
CoreExport bool Quitting
Definition: main.cpp:34
void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override
Definition: inspircd20.cpp:45
Message::Error message_error
Definition: inspircd20.cpp:803
bool CanSQLine
Definition: protocol.h:57
ModeType type
Definition: modes.h:49
Definition: Config.cs:26
bool CanSVSNick
Definition: protocol.h:49
bool CanCertFP
Definition: protocol.h:67
void SetRealname(const Anope::string &realname)
Definition: users.cpp:279
Message::MOTD message_motd
Definition: inspircd20.cpp:808
Message::Privmsg message_privmsg
Definition: inspircd20.cpp:812
void SendLogout(User *u) anope_override
Definition: inspircd20.cpp:72
ServiceAlias message_nick
Definition: inspircd20.cpp:818
unsigned MaxModes
Definition: protocol.h:73
CoreExport bool Match(const string &str, const string &mask, bool case_sensitive=false, bool use_regex=false)
Definition: misc.cpp:407
ServiceAlias message_ftopic
Definition: inspircd20.cpp:818
ChannelModeFlood(char modeChar)
Definition: inspircd20.cpp:314
static char GetStatusChar(char symbol)
Definition: modes.cpp:558
static bool AddUserMode(UserMode *um)
Definition: modes.cpp:391
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:31
ServiceAlias message_fjoin
Definition: inspircd20.cpp:818
static const size_type npos
Definition: anope.h:44
void SetFlag(IRCDMessageFlag f)
Definition: protocol.h:282
CoreExport time_t DoTime(const Anope::string &s)
Definition: misc.cpp:275
void SetIdent(const Anope::string &ident)
Definition: users.cpp:255
Message::Stats message_stats
Definition: inspircd20.cpp:814
string replace_all_cs(const string &_orig, const string &_repl) const
Definition: anope.h:229
IRCDMessageCapab(Module *creator)
Definition: inspircd20.cpp:352
void SendSASLMessage(const SASL::Message &message) anope_override
Definition: inspircd20.cpp:74
void OnDelChan(ChannelInfo *ci) anope_override
Definition: inspircd20.cpp:911
ServiceReference< IRCDMessage > insp12_encap
Definition: inspircd20.cpp:743
bool Matches(User *u, const Entry *e) anope_override
Definition: inspircd20.cpp:183
static ServiceReference< IRCDProto > insp12("IRCDProto","inspircd12")
Definition: modes.h:68
bool Matches(User *u, const Entry *e) anope_override
Definition: inspircd20.cpp:228
char mchar
Definition: modes.h:47
static ChannelMode * FindChannelModeByChar(char mode)
Definition: modes.cpp:524
void SendAkillDel(const XLine *x) anope_override
Definition: inspircd20.cpp:48
InspIRCdExtBan(const Anope::string &mname, const Anope::string &basename, char extban)
Definition: inspircd20.cpp:85
bool IsValid(Anope::string &value) const anope_override
Definition: inspircd20.cpp:341
Message::Part message_part
Definition: inspircd20.cpp:810
static Anope::map< std::pair< bool, Anope::string > > modes
Definition: cs_mode.cpp:745
#define anope_override
Definition: services.h:56
bool empty() const
Definition: anope.h:126
bool Matches(User *u, const Entry *e) anope_override
Definition: inspircd20.cpp:115
SimpleNumberParamMode(const Anope::string &modename, char modeChar)
Definition: inspircd20.cpp:289
FinerprintMatcher(const Anope::string &mname, const Anope::string &mbase, char c)
Definition: inspircd20.cpp:209
void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) anope_override
Definition: inspircd20.cpp:53
CoreExport IRCDProto * IRCD
Definition: protocol.cpp:23
std::basic_string< char, ci_char_traits, std::allocator< char > > string
Definition: hashcomp.h:133
EventReturn
Definition: modules.h:129
ServiceAlias message_squit
Definition: inspircd20.cpp:818
#define MODULE_INIT(x)
Definition: modules.h:45
Server * server
Definition: users.h:77
ServiceAlias message_uid
Definition: inspircd20.cpp:818
EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string &param) anope_override
Definition: inspircd20.cpp:959
ServiceAlias message_endburst
Definition: inspircd20.cpp:818
ChanUserContainer * FindUser(User *u) const
Definition: channels.cpp:173
void SetDisplayedHost(const Anope::string &host)
Definition: users.cpp:189
ChannelMode * Wrap(Anope::string &param) anope_override
Definition: modes.cpp:216
ChannelMode * Wrap(Anope::string &param) anope_override
Definition: inspircd20.cpp:90
bool CanSVSHold
Definition: protocol.h:63
static void DetachAll(Module *mod)
ChannelStatus status
Definition: channels.h:28
void OnReload(Configuration::Conf *conf) anope_override
Definition: inspircd20.cpp:878
void SendSVSHold(const Anope::string &nick, time_t t) anope_override
Definition: inspircd20.cpp:61
Message::Quit message_quit
Definition: inspircd20.cpp:813
void SendSVSJoin(const MessageSource &source, User *u, const Anope::string &chan, const Anope::string &other) anope_override
Definition: inspircd20.cpp:65
bool Matches(User *u, const Entry *e) anope_override
Definition: inspircd20.cpp:213
static User * Find(const Anope::string &name, bool nick_only=false)
Definition: users.cpp:815
static bool AddChannelMode(ChannelMode *cm)
Definition: modes.cpp:418
static ModuleReturn LoadModule(const Anope::string &modname, User *u)
EventReturn OnUnMLock(ChannelInfo *ci, ModeLock *lock) anope_override
Definition: inspircd20.cpp:933
iterator end()
Definition: anope.h:284
static Channel * Find(const Anope::string &name)
Definition: channels.cpp:920
Definition: xline.h:18
bool GetToken(Anope::string &token)
Definition: hashcomp.cpp:99
T anope_dynamic_static_cast(O ptr)
Definition: anope.h:774
Definition: inspircd20.cpp:108
ServiceAlias message_mode
Definition: inspircd20.cpp:818
void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf)
Definition: inspircd20.cpp:70
void SendClientIntroduction(User *u) anope_override
Definition: inspircd20.cpp:54
CoreExport Server * Me
Definition: servers.cpp:24
RealnameMatcher(const Anope::string &mname, const Anope::string &mbase, char c)
Definition: inspircd20.cpp:179
std::map< char, Anope::string > chmodes
Definition: inspircd20.cpp:350
ChannelModeRedirect(char modeChar)
Definition: inspircd20.cpp:339
bool IsIdentValid(const Anope::string &ident) anope_override
Definition: inspircd20.cpp:77
void SendSquit(Server *s, const Anope::string &message) anope_override
Definition: inspircd20.cpp:56
void SendChannelMetadata(Channel *c, const Anope::string &metadataname, const Anope::string &value)
Definition: inspircd20.cpp:830
void SendSZLine(User *u, const XLine *x) anope_override
Definition: inspircd20.cpp:64
ServiceAlias message_fhost
Definition: inspircd20.cpp:818
Definition: logger.h:53
Message::Notice message_notice
Definition: inspircd20.cpp:809
Message::Ping message_ping
Definition: inspircd20.cpp:811
bool CanSVSJoin
Definition: protocol.h:51
ChannelMode * Unwrap(ChannelMode *cm, Anope::string &param) anope_override
Definition: inspircd20.cpp:96
void SendBOB() anope_override
Definition: inspircd20.cpp:68
bool Matches(User *u, const Entry *e) anope_override
Definition: inspircd20.cpp:167
IRCDMessageEncap(Module *creator)
Definition: inspircd20.cpp:745
static unsigned int spanningtree_proto_ver
Definition: inspircd20.cpp:15
Definition: modes.h:388
ServiceAlias message_idle
Definition: inspircd20.cpp:818
Anope::string name
Definition: modes.h:43
void SendChannel(Channel *c) anope_override
Definition: inspircd20.cpp:73
Message::Away message_away
Definition: inspircd20.cpp:802
iterator begin()
Definition: anope.h:282
Message::Join message_join
Definition: inspircd20.cpp:805
bool IsValid(Anope::string &value) const anope_override
Definition: inspircd20.cpp:316
size_type find(const string &_str, size_type pos=0) const
Definition: anope.h:192
ServerMatcher(const Anope::string &mname, const Anope::string &mbase, char c)
Definition: inspircd20.cpp:194
CoreExport Anope::string QuitReason
Definition: main.cpp:36
bool use_server_side_topiclock
Definition: inspircd20.cpp:828
void SendVhostDel(User *u) anope_override
Definition: inspircd20.cpp:50
bool IsValid(Anope::string &value) const anope_override
Definition: inspircd20.cpp:330
void SendSWhois(const MessageSource &bi, const Anope::string &who, const Anope::string &mask) anope_override
Definition: inspircd20.cpp:67
ServiceAlias message_opertype
Definition: inspircd20.cpp:818
IRCDMessageFIdent message_fident
Definition: inspircd20.cpp:826
void SendSQLine(User *u, const XLine *x) anope_override
Definition: inspircd20.cpp:59
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: inspircd20.cpp:354