Anope IRC Services  Version 2.0
ngircd.cpp
Go to the documentation of this file.
1 /*
2  * ngIRCd Protocol module for Anope IRC Services
3  *
4  * (C) 2012 Anope Team <team@anope.org>
5  * (C) 2011-2012, 2014 Alexander Barton <alex@barton.de>
6  * (C) 2011 Anope Team <team@anope.org>
7  *
8  * Please read COPYING and README for further details.
9  *
10  * Based on the original code of Epona by Lara.
11  * Based on the original code of Services by Andy Church.
12  */
13 
14 #include "module.h"
15 
16 class ngIRCdProto : public IRCDProto
17 {
18  void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override
19  {
20  IRCDProto::SendSVSKillInternal(source, user, buf);
21  user->KillInternal(source, buf);
22  }
23 
24  public:
25  ngIRCdProto(Module *creator) : IRCDProto(creator, "ngIRCd")
26  {
28  CanCertFP = true;
29  CanSVSNick = true;
30  CanSetVHost = true;
31  CanSetVIdent = true;
32  MaxModes = 5;
33  }
34 
36  {
37  // Calculate the time left before this would expire, capping it at 2 days
38  time_t timeleft = x->expires - Anope::CurTime;
39  if (timeleft > 172800 || !x->expires)
40  timeleft = 172800;
41  UplinkSocket::Message(Me) << "GLINE " << x->mask << " " << timeleft << " :" << x->GetReason() << " (" << x->by << ")";
42  }
43 
45  {
46  UplinkSocket::Message(Me) << "GLINE " << x->mask;
47  }
48 
50  {
51  UplinkSocket::Message(Me) << "CHANINFO " << c->name << " +" << c->GetModes(true, true);
52  }
53 
54  // Received: :dev.anope.de NICK DukeP 1 ~DukePyro p57ABF9C9.dip.t-dialin.net 1 +i :DukePyrolator
56  {
57  Anope::string modes = "+" + u->GetModes();
58  UplinkSocket::Message(Me) << "NICK " << u->nick << " 1 " << u->GetIdent() << " " << u->host << " 1 " << modes << " :" << u->realname;
59  }
60 
62  {
63  UplinkSocket::Message() << "PASS " << Config->Uplinks[Anope::CurrentUplink].password << " 0210-IRC+ Anope|" << Anope::VersionShort() << ":CLHMSo P";
64  /* Make myself known to myself in the serverlist */
65  SendServer(Me);
66  /* finish the enhanced server handshake and register the connection */
67  this->SendNumeric(376, "*", ":End of MOTD command");
68  }
69 
70  void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) anope_override
71  {
72  UplinkSocket::Message(Me) << "SVSNICK " << u->nick << " " << newnick;
73  }
74 
75  void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override
76  {
77  UplinkSocket::Message(bi) << "NOTICE $" << dest->GetName() << " :" << msg;
78  }
79 
80  void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override
81  {
82  UplinkSocket::Message(bi) << "PRIVMSG $" << dest->GetName() << " :" << msg;
83  }
84 
86  {
87  UplinkSocket::Message(source) << "WALLOPS :" << buf;
88  }
89 
90  void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override
91  {
92  UplinkSocket::Message(user) << "JOIN " << c->name;
93  if (status)
94  {
95  /* First save the channel status incase uc->Status == status */
96  ChannelStatus cs = *status;
97  /* If the user is internally on the channel with flags, kill them so that
98  * the stacker will allow this.
99  */
100  ChanUserContainer *uc = c->FindUser(user);
101  if (uc != NULL)
102  uc->status.Clear();
103 
104  BotInfo *setter = BotInfo::Find(user->GetUID());
105  for (size_t i = 0; i < cs.Modes().length(); ++i)
106  c->SetMode(setter, ModeManager::FindChannelModeByChar(cs.Modes()[i]), user->GetUID(), false);
107 
108  if (uc != NULL)
109  uc->status = cs;
110  }
111  }
112 
113  void SendKickInternal(const MessageSource &source, const Channel *chan, User *user, const Anope::string &buf) anope_override
114  {
115  if (!buf.empty())
116  UplinkSocket::Message(source) << "KICK " << chan->name << " " << user->nick << " :" << buf;
117  else
118  UplinkSocket::Message(source) << "KICK " << chan->name << " " << user->nick;
119  }
120 
122  {
123  UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountname :" << na->nc->display;
124  }
125 
127  {
128  UplinkSocket::Message(Me) << "METADATA " << u->GetUID() << " accountname :";
129  }
130 
131  void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) anope_override
132  {
133  UplinkSocket::Message(source) << "MODE " << dest->name << " " << buf;
134  }
135 
136  void SendPartInternal(User *u, const Channel *chan, const Anope::string &buf) anope_override
137  {
138  if (!buf.empty())
139  UplinkSocket::Message(u) << "PART " << chan->name << " :" << buf;
140  else
141  UplinkSocket::Message(u) << "PART " << chan->name;
142  }
143 
144  /* SERVER name hop descript */
145  void SendServer(const Server *server) anope_override
146  {
147  UplinkSocket::Message() << "SERVER " << server->GetName() << " " << server->GetHops() << " :" << server->GetDescription();
148  }
149 
151  {
152  UplinkSocket::Message(source) << "TOPIC " << c->name << " :" << c->topic;
153  }
154 
155  void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) anope_override
156  {
157  if (!vIdent.empty())
158  UplinkSocket::Message(Me) << "METADATA " << u->nick << " user :" << vIdent;
159 
160  UplinkSocket::Message(Me) << "METADATA " << u->nick << " cloakhost :" << vhost;
161  if (!u->HasMode("CLOAK"))
162  {
163  u->SetMode(Config->GetClient("HostServ"), "CLOAK");
165  }
166  }
167 
169  {
170  this->SendVhost(u, u->GetIdent(), "");
171  }
172 };
173 
175 {
176  IRCDMessage005(Module *creator) : IRCDMessage(creator, "005", 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
177 
178  // Please see <http://www.irc.org/tech_docs/005.html> for details.
179  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
180  {
181  size_t pos;
182  Anope::string parameter, data;
183  for (unsigned i = 0, end = params.size(); i < end; ++i)
184  {
185  pos = params[i].find('=');
186  if (pos != Anope::string::npos)
187  {
188  parameter = params[i].substr(0, pos);
189  data = params[i].substr(pos+1, params[i].length());
190  if (parameter == "MODES")
191  {
192  unsigned maxmodes = convertTo<unsigned>(data);
193  IRCD->MaxModes = maxmodes;
194  }
195  else if (parameter == "NICKLEN")
196  {
197  unsigned newlen = convertTo<unsigned>(data), len = Config->GetBlock("networkinfo")->Get<unsigned>("nicklen");
198  if (len != newlen)
199  {
200  Log() << "Warning: NICKLEN is " << newlen << " but networkinfo:nicklen is " << len;
201  }
202  }
203  }
204  }
205  }
206 };
207 
209 {
210  IRCDMessage376(Module *creator) : IRCDMessage(creator, "376", 2) { }
211 
212  /*
213  * :ngircd.dev.anope.de 376 services.anope.de :End of MOTD command
214  *
215  * we do nothing here, this function exists only to
216  * avoid the "unknown message from server" message.
217  *
218  */
219 
220  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
221  {
222  }
223 };
224 
226 {
228 
229  /*
230  * CHANINFO is used by servers to inform each other about a channel: its
231  * modes, channel key, user limits and its topic. The parameter combination
232  * <key> and <limit> is optional, as well as the <topic> parameter, so that
233  * there are three possible forms of this command:
234  *
235  * CHANINFO <chan> +<modes>
236  * CHANINFO <chan> +<modes> :<topic>
237  * CHANINFO <chan> +<modes> <key> <limit> :<topic>
238  *
239  * The parameter <key> must be ignored if a channel has no key (the parameter
240  * <modes> doesn't list the "k" channel mode). In this case <key> should
241  * contain "*" because the parameter <key> is required by the CHANINFO syntax
242  * and therefore can't be omitted. The parameter <limit> must be ignored when
243  * a channel has no user limit (the parameter <modes> doesn't list the "l"
244  * channel mode). In this case <limit> should be "0".
245  */
246  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
247  {
248  bool created;
249  Channel *c = Channel::FindOrCreate(params[0], created);
250 
251  Anope::string modes = params[1];
252 
253  if (params.size() == 3)
254  {
255  c->ChangeTopicInternal(source.GetName(), params[2], Anope::CurTime);
256  }
257  else if (params.size() == 5)
258  {
259  for (size_t i = 0, end = params[1].length(); i < end; ++i)
260  {
261  switch(params[1][i])
262  {
263  case 'k':
264  modes += " " + params[2];
265  continue;
266  case 'l':
267  modes += " " + params[3];
268  continue;
269  }
270  }
271  c->ChangeTopicInternal(source.GetName(), params[4], Anope::CurTime);
272  }
273 
274  c->SetModesInternal(source, modes);
275  }
276 };
277 
279 {
280  IRCDMessageJoin(Module *creator) : Message::Join(creator, "JOIN") { }
281 
282  /*
283  * <@po||ux> DukeP: RFC 2813, 4.2.1: the JOIN command on server-server links
284  * separates the modes ("o") with ASCII 7, not space. And you can't see ASCII 7.
285  *
286  * if a user joins a new channel, the ircd sends <channelname>\7<umode>
287  */
288  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
289  {
290  User *user = source.GetUser();
291  size_t pos = params[0].find('\7');
292  Anope::string channel, modes;
293 
294  if (pos != Anope::string::npos)
295  {
296  channel = params[0].substr(0, pos);
297  modes = '+' + params[0].substr(pos+1, params[0].length()) + " " + user->nick;
298  }
299  else
300  {
301  channel = params[0];
302  }
303 
304  std::vector<Anope::string> new_params;
305  new_params.push_back(channel);
306 
307  Message::Join::Run(source, new_params);
308 
309  if (!modes.empty())
310  {
311  Channel *c = Channel::Find(channel);
312  if (c)
313  c->SetModesInternal(source, modes);
314  }
315  }
316 };
317 
319 {
320  IRCDMessageMetadata(Module *creator) : IRCDMessage(creator, "METADATA", 3) { SetFlag(IRCDMESSAGE_REQUIRE_SERVER); }
321 
322  /*
323  * Received: :ngircd.dev.anope.de METADATA DukePyrolator host :anope-e2ee5c7d
324  *
325  * params[0] = nick of the user
326  * params[1] = command
327  * params[2] = data
328  *
329  * following commands are supported:
330  * - "accountname": the account name of a client (can't be empty)
331  * - "certfp": the certificate fingerprint of a client (can't be empty)
332  * - "cloakhost" : the cloaked hostname of a client
333  * - "host": the hostname of a client (can't be empty)
334  * - "info": info text ("real name") of a client
335  * - "user": the user name (ident) of a client (can't be empty)
336  */
337 
338  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
339  {
340  User *u = User::Find(params[0]);
341  if (!u)
342  {
343  Log() << "received METADATA for non-existent user " << params[0];
344  return;
345  }
346  if (params[1].equals_cs("accountname"))
347  {
348  NickCore *nc = NickCore::Find(params[2]);
349  if (nc)
350  u->Login(nc);
351  }
352  else if (params[1].equals_cs("certfp"))
353  {
354  u->fingerprint = params[2];
355  FOREACH_MOD(OnFingerprint, (u));
356  }
357  else if (params[1].equals_cs("cloakhost"))
358  {
359  if (!params[2].empty())
360  u->SetDisplayedHost(params[2]);
361  }
362  else if (params[1].equals_cs("host"))
363  {
364  u->SetCloakedHost(params[2]);
365  }
366  else if (params[1].equals_cs("info"))
367  {
368  u->SetRealname(params[2]);
369  }
370  else if (params[1].equals_cs("user"))
371  {
372  u->SetVIdent(params[2]);
373  }
374  }
375 };
376 
378 {
379  IRCDMessageMode(Module *creator) : IRCDMessage(creator, "MODE", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
380 
381  /*
382  * Received: :DukeP MODE #anope +b *!*@*.aol.com
383  * Received: :DukeP MODE #anope +h DukeP
384  * params[0] = channel or nick
385  * params[1] = modes
386  * params[n] = parameters
387  */
388 
389  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
390  {
391  Anope::string modes = params[1];
392 
393  for (size_t i = 2; i < params.size(); ++i)
394  modes += " " + params[i];
395 
396  if (IRCD->IsChannelValid(params[0]))
397  {
398  Channel *c = Channel::Find(params[0]);
399 
400  if (c)
401  c->SetModesInternal(source, modes);
402  }
403  else
404  {
405  User *u = User::Find(params[0]);
406 
407  if (u)
408  u->SetModesInternal(source, "%s", params[1].c_str());
409  }
410  }
411 };
412 
414 {
415  IRCDMessageNick(Module *creator) : IRCDMessage(creator, "NICK", 1) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
416 
417  /*
418  * NICK - NEW
419  * Received: :dev.anope.de NICK DukeP_ 1 ~DukePyro ip-2-201-236-154.web.vodafone.de 1 + :DukePyrolator
420  * Parameters: <nickname> <hopcount> <username> <host> <servertoken> <umode> :<realname>
421  * source = server
422  * params[0] = nick
423  * params[1] = hopcount
424  * params[2] = username/ident
425  * params[3] = host
426  * params[4] = servertoken
427  * params[5] = modes
428  * params[6] = info
429  *
430  * NICK - change
431  * Received: :DukeP_ NICK :test2
432  * source = oldnick
433  * params[0] = newnick
434  *
435  */
436  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
437  {
438  if (params.size() == 1)
439  {
440  // we have a nickchange
441  source.GetUser()->ChangeNick(params[0]);
442  }
443  else if (params.size() == 7)
444  {
445  // a new user is connecting to the network
446  User::OnIntroduce(params[0], params[2], params[3], "", "", source.GetServer(), params[6], Anope::CurTime, params[5], "", NULL);
447  }
448  else
449  {
450  Log(LOG_DEBUG) << "Received NICK with invalid number of parameters. source = " << source.GetName() << "params[0] = " << params[0] << "params.size() = " << params.size();
451  }
452  }
453 };
454 
456 {
458 
459  /*
460  * RFC 2813, 4.2.2: Njoin Message:
461  * The NJOIN message is used between servers only.
462  * It is used when two servers connect to each other to exchange
463  * the list of channel members for each channel.
464  *
465  * Even though the same function can be performed by using a succession
466  * of JOIN, this message SHOULD be used instead as it is more efficient.
467  *
468  * Received: :dev.anope.de NJOIN #test :DukeP2,@DukeP,%test,+test2
469  */
470  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
471  {
472  std::list<Message::Join::SJoinUser> users;
473 
474  commasepstream sep(params[1]);
475  Anope::string buf;
476  while (sep.GetToken(buf))
477  {
478 
480 
481  /* Get prefixes from the nick */
482  for (char ch; (ch = ModeManager::GetStatusChar(buf[0]));)
483  {
484  buf.erase(buf.begin());
485  sju.first.AddMode(ch);
486  }
487 
488  sju.second = User::Find(buf);
489  if (!sju.second)
490  {
491  Log(LOG_DEBUG) << "NJOIN for nonexistant user " << buf << " on " << params[0];
492  continue;
493  }
494  users.push_back(sju);
495  }
496 
497  Message::Join::SJoin(source, params[0], 0, "", users);
498  }
499 };
500 
502 {
504 
505  /*
506  * ngIRCd does not send an EOB, so we send a PING immediately
507  * when receiving a new server and then finish sync once we
508  * get a pong back from that server.
509  */
510  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
511  {
512  if (!source.GetServer()->IsSynced())
513  source.GetServer()->Sync(false);
514  }
515 };
516 
518 {
519  IRCDMessageServer(Module *creator) : IRCDMessage(creator, "SERVER", 3) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
520 
521  /*
522  * SERVER tolsun.oulu.fi 1 :Experimental server
523  * New server tolsun.oulu.fi introducing itself
524  * and attempting to register.
525  *
526  * RFC 2813 says the server has to send a hopcount
527  * AND a servertoken. Not quite sure what ngIRCd is
528  * sending here.
529  *
530  * params[0] = servername
531  * params[1] = hop count (or servertoken?)
532  * params[2] = server description
533  *
534  *
535  * :tolsun.oulu.fi SERVER csd.bu.edu 5 34 :BU Central Server
536  * Server tolsun.oulu.fi is our uplink for csd.bu.edu
537  * which is 5 hops away. The token "34" will be used
538  * by tolsun.oulu.fi when introducing new users or
539  * services connected to csd.bu.edu.
540  *
541  * params[0] = servername
542  * params[1] = hop count
543  * params[2] = server numeric
544  * params[3] = server description
545  */
546 
547  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
548  {
549  if (params.size() == 3)
550  {
551  // our uplink is introducing itself
552  new Server(Me, params[0], 1, params[2], "");
553  }
554  else
555  {
556  // our uplink is introducing a new server
557  unsigned int hops = params[1].is_pos_number_only() ? convertTo<unsigned>(params[1]) : 0;
558  new Server(source.GetServer(), params[0], hops, params[2], params[3]);
559  }
560  /*
561  * ngIRCd does not send an EOB, so we send a PING immediately
562  * when receiving a new server and then finish sync once we
563  * get a pong back from that server.
564  */
565  IRCD->SendPing(Me->GetName(), params[0]);
566  }
567 };
568 
570 {
571  IRCDMessageTopic(Module *creator) : IRCDMessage(creator, "TOPIC", 2) { SetFlag(IRCDMESSAGE_SOFT_LIMIT); }
572 
573  // Received: :DukeP TOPIC #anope :test
574  void Run(MessageSource &source, const std::vector<Anope::string> &params) anope_override
575  {
576  Channel *c = Channel::Find(params[0]);
577  if (!c)
578  {
579  Log(LOG_DEBUG) << "TOPIC for nonexistant channel " << params[0];
580  return;
581  }
582  c->ChangeTopicInternal(source.GetName(), params[1], Anope::CurTime);
583  }
584 };
585 
586 
587 
588 class ProtongIRCd : public Module
589 {
591 
592  /* Core message handlers */
609 
610  /* Our message handlers */
622 
623  void AddModes()
624  {
625  /* Add user modes */
626  ModeManager::AddUserMode(new UserMode("NOCTCP", 'b'));
627  ModeManager::AddUserMode(new UserMode("BOT", 'B'));
628  ModeManager::AddUserMode(new UserMode("COMMONCHANS", 'C'));
629  ModeManager::AddUserMode(new UserMode("INVIS", 'i'));
630  ModeManager::AddUserMode(new UserModeOperOnly("OPER", 'o'));
631  ModeManager::AddUserMode(new UserModeOperOnly("PROTECTED", 'q'));
632  ModeManager::AddUserMode(new UserModeOperOnly("RESTRICTED", 'r'));
633  ModeManager::AddUserMode(new UserModeNoone("REGISTERED", 'R'));
634  ModeManager::AddUserMode(new UserModeOperOnly("SNOMASK", 's'));
635  ModeManager::AddUserMode(new UserMode("WALLOPS", 'w'));
636  ModeManager::AddUserMode(new UserMode("CLOAK", 'x'));
637 
638  /* Add modes for ban, exception, and invite lists */
640  ModeManager::AddChannelMode(new ChannelModeList("EXCEPT", 'e'));
641  ModeManager::AddChannelMode(new ChannelModeList("INVITEOVERRIDE", 'I'));
642 
643  /* Add channel user modes */
644  ModeManager::AddChannelMode(new ChannelModeStatus("VOICE", 'v', '+', 0));
645  ModeManager::AddChannelMode(new ChannelModeStatus("HALFOP", 'h', '%', 1));
646  ModeManager::AddChannelMode(new ChannelModeStatus("OP", 'o', '@', 2));
647  ModeManager::AddChannelMode(new ChannelModeStatus("PROTECT", 'a', '&', 3));
648  ModeManager::AddChannelMode(new ChannelModeStatus("OWNER", 'q', '~', 4));
649 
650  /* Add channel modes */
651  ModeManager::AddChannelMode(new ChannelMode("INVITE", 'i'));
653  ModeManager::AddChannelMode(new ChannelModeParam("LIMIT", 'l', true));
654  ModeManager::AddChannelMode(new ChannelMode("MODERATED", 'm'));
655  ModeManager::AddChannelMode(new ChannelMode("REGMODERATED", 'M'));
656  ModeManager::AddChannelMode(new ChannelMode("NOEXTERNAL", 'n'));
657  ModeManager::AddChannelMode(new ChannelMode("OPERONLY", 'O'));
658  ModeManager::AddChannelMode(new ChannelMode("PERM", 'P'));
659  ModeManager::AddChannelMode(new ChannelMode("NOKICK", 'Q'));
660  ModeManager::AddChannelMode(new ChannelModeNoone("REGISTERED", 'r'));
661  ModeManager::AddChannelMode(new ChannelMode("REGISTEREDONLY", 'R'));
662  ModeManager::AddChannelMode(new ChannelMode("SECRET", 's'));
663  ModeManager::AddChannelMode(new ChannelMode("TOPIC", 't'));
664  ModeManager::AddChannelMode(new ChannelMode("NOINVITE", 'V'));
665  ModeManager::AddChannelMode(new ChannelMode("SSL", 'z'));
666  }
667 
668  public:
669  ProtongIRCd(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PROTOCOL | VENDOR),
670  ircd_proto(this),
671  message_capab(this), message_error(this), message_invite(this), message_kick(this), message_kill(this),
672  message_motd(this), message_notice(this), message_part(this), message_ping(this), message_privmsg(this),
673  message_squery(this, "SQUERY"), message_quit(this), message_squit(this), message_stats(this), message_time(this),
674  message_version(this), message_whois(this),
675 
676  message_005(this), message_376(this), message_chaninfo(this), message_join(this), message_metadata(this),
677  message_mode(this), message_nick(this), message_njoin(this), message_pong(this), message_server(this),
678  message_topic(this)
679  {
680 
681  Servers::Capab.insert("QS");
682 
683  this->AddModes();
684 
685  }
686 
688  {
689  u->RemoveMode(Config->GetClient("NickServ"), "REGISTERED");
690  }
691 };
692 
Definition: bots.h:24
IRCDMessageTopic(Module *creator)
Definition: ngircd.cpp:571
void AddModes()
Definition: ngircd.cpp:623
Message::Part message_part
Definition: ngircd.cpp:600
Definition: servers.h:42
void SetCloakedHost(const Anope::string &newhost)
Definition: users.cpp:213
void SendGlobopsInternal(const MessageSource &source, const Anope::string &buf) anope_override
Definition: ngircd.cpp:85
IRCDMessageServer(Module *creator)
Definition: ngircd.cpp:519
Message::Capab message_capab
Definition: ngircd.cpp:593
IRCDMessageServer message_server
Definition: ngircd.cpp:620
void SendConnect() anope_override
Definition: ngircd.cpp:61
IRCDMessageTopic message_topic
Definition: ngircd.cpp:621
void SendKickInternal(const MessageSource &source, const Channel *chan, User *user, const Anope::string &buf) anope_override
Definition: ngircd.cpp:113
Message::Kill message_kill
Definition: ngircd.cpp:597
void SetMode(BotInfo *bi, UserMode *um, const Anope::string &param="")
Definition: users.cpp:573
Message::Whois message_whois
Definition: ngircd.cpp:608
virtual void SendSVSKillInternal(const MessageSource &, User *, const Anope::string &)
Definition: protocol.cpp:100
Message::Ping message_ping
Definition: ngircd.cpp:601
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: ngircd.cpp:547
IRCDMessageMode(Module *creator)
Definition: ngircd.cpp:379
Anope::string fingerprint
Definition: users.h:73
IRCDMessageMode message_mode
Definition: ngircd.cpp:616
void SendGlobalPrivmsg(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override
Definition: ngircd.cpp:80
void push_back(char c)
Definition: anope.h:142
CoreExport std::set< Anope::string > Capab
Definition: servers.cpp:29
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: ngircd.cpp:436
IRCDMessageMetadata message_metadata
Definition: ngircd.cpp:615
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:63
Join(Module *creator, const Anope::string &mname="JOIN")
Definition: messages.h:53
Message::Error message_error
Definition: ngircd.cpp:594
ngIRCdProto(Module *creator)
Definition: ngircd.cpp:25
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: ngircd.cpp:338
static User * OnIntroduce(const Anope::string &snick, const Anope::string &sident, const Anope::string &shost, const Anope::string &svhost, const Anope::string &sip, Server *sserver, const Anope::string &srealname, time_t ts, const Anope::string &smodes, const Anope::string &suid, NickCore *nc)
Definition: users.cpp:116
Definition: users.h:34
IRCDMessageNJoin(Module *creator)
Definition: ngircd.cpp:457
Anope::string DefaultPseudoclientModes
Definition: protocol.h:47
IRCDMessagePong(Module *creator)
Definition: ngircd.cpp:503
void SendServer(const Server *server) anope_override
Definition: ngircd.cpp:145
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: ngircd.cpp:470
bool CanSetVHost
Definition: protocol.h:53
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: ngircd.cpp:179
static Channel * FindOrCreate(const Anope::string &name, bool &created, time_t ts=Anope::CurTime)
Definition: channels.cpp:929
void SendVhostDel(User *u) anope_override
Definition: ngircd.cpp:168
CoreExport time_t CurTime
Definition: main.cpp:41
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: ngircd.cpp:574
#define FOREACH_MOD(ename, args)
Definition: modules.h:62
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: ngircd.cpp:288
iterator erase(const iterator &i)
Definition: anope.h:155
IRCDMessagePong message_pong
Definition: ngircd.cpp:619
string substr(size_type pos=0, size_type n=npos) const
Definition: anope.h:277
IRCDMessageMetadata(Module *creator)
Definition: ngircd.cpp:320
bool CanSetVIdent
Definition: protocol.h:53
IRCDMessageNJoin message_njoin
Definition: ngircd.cpp:618
size_type length() const
Definition: anope.h:131
void SendAkill(User *u, XLine *x) anope_override
Definition: ngircd.cpp:35
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: ngircd.cpp:510
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
IRCDMessageChaninfo message_chaninfo
Definition: ngircd.cpp:613
void OnUserNickChange(User *u, const Anope::string &) anope_override
Definition: ngircd.cpp:687
Message::Privmsg message_squery
Definition: ngircd.cpp:602
unsigned MaxModes
Definition: protocol.h:73
void SendAkillDel(const XLine *x) anope_override
Definition: ngircd.cpp:44
static char GetStatusChar(char symbol)
Definition: modes.cpp:558
void SendPartInternal(User *u, const Channel *chan, const Anope::string &buf) anope_override
Definition: ngircd.cpp:136
static bool AddUserMode(UserMode *um)
Definition: modes.cpp:391
void SendVhost(User *u, const Anope::string &vIdent, const Anope::string &vhost) anope_override
Definition: ngircd.cpp:155
static const size_type npos
Definition: anope.h:44
void SetFlag(IRCDMessageFlag f)
Definition: protocol.h:282
virtual void SendPing(const Anope::string &servname, const Anope::string &who)
Definition: protocol.cpp:262
CoreExport string VersionShort()
Definition: misc.cpp:634
Message::Quit message_quit
Definition: ngircd.cpp:603
Message::Version message_version
Definition: ngircd.cpp:607
void ChangeTopicInternal(const Anope::string &user, const Anope::string &newtopic, time_t ts=Anope::CurTime)
Definition: channels.cpp:786
Definition: modes.h:68
Message::MOTD message_motd
Definition: ngircd.cpp:598
void SetVIdent(const Anope::string &ident)
Definition: users.cpp:238
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: ngircd.cpp:220
void SendModeInternal(const MessageSource &source, const Channel *dest, const Anope::string &buf) anope_override
Definition: ngircd.cpp:131
static ChannelMode * FindChannelModeByChar(char mode)
Definition: modes.cpp:524
virtual void SendNumeric(int numeric, const Anope::string &dest, const char *fmt,...)
Definition: protocol.cpp:339
Message::SQuit message_squit
Definition: ngircd.cpp:604
static Anope::map< std::pair< bool, Anope::string > > modes
Definition: cs_mode.cpp:745
IRCDMessageJoin(Module *creator)
Definition: ngircd.cpp:280
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: ngircd.cpp:246
#define anope_override
Definition: services.h:56
IRCDMessageJoin message_join
Definition: ngircd.cpp:614
bool empty() const
Definition: anope.h:126
ProtongIRCd(const Anope::string &modname, const Anope::string &creator)
Definition: ngircd.cpp:669
IRCDMessageChaninfo(Module *creator)
Definition: ngircd.cpp:227
ngIRCdProto ircd_proto
Definition: ngircd.cpp:590
IRCDMessage005 message_005
Definition: ngircd.cpp:611
void SetModesInternal(MessageSource &source, const Anope::string &mode, time_t ts=0, bool enforce_mlock=true)
Definition: channels.cpp:595
void SendGlobalNotice(BotInfo *bi, const Server *dest, const Anope::string &msg) anope_override
Definition: ngircd.cpp:75
IRCDMessage376(Module *creator)
Definition: ngircd.cpp:210
CoreExport IRCDProto * IRCD
Definition: protocol.cpp:23
void SendLogout(User *u) anope_override
Definition: ngircd.cpp:126
void SendChannel(Channel *c) anope_override
Definition: ngircd.cpp:49
#define MODULE_INIT(x)
Definition: modules.h:45
Message::Kick message_kick
Definition: ngircd.cpp:596
void SendForceNickChange(User *u, const Anope::string &newnick, time_t when) anope_override
Definition: ngircd.cpp:70
void SetDisplayedHost(const Anope::string &host)
Definition: users.cpp:189
IRCDMessage005(Module *creator)
Definition: ngircd.cpp:176
void SendLogin(User *u, NickAlias *na) anope_override
Definition: ngircd.cpp:121
Message::Notice message_notice
Definition: ngircd.cpp:599
ChannelStatus status
Definition: channels.h:28
Message::Stats message_stats
Definition: ngircd.cpp:605
IRCDMessage376 message_376
Definition: ngircd.cpp:612
void Login(NickCore *core)
Definition: users.cpp:391
void RemoveMode(BotInfo *bi, UserMode *um, const Anope::string &param="")
Definition: users.cpp:587
CoreExport int CurrentUplink
Definition: main.cpp:43
static void ProcessModes()
Definition: modes.cpp:633
std::pair< ChannelStatus, User * > SJoinUser
Definition: messages.h:57
Anope::string nick
Definition: users.h:62
virtual bool IsChannelValid(const Anope::string &)
Definition: protocol.cpp:372
static User * Find(const Anope::string &name, bool nick_only=false)
Definition: users.cpp:815
void Clear()
Definition: modes.cpp:91
const Anope::string & GetName() const
Definition: servers.cpp:175
static bool AddChannelMode(ChannelMode *cm)
Definition: modes.cpp:418
static Channel * Find(const Anope::string &name)
Definition: channels.cpp:920
Definition: xline.h:18
bool GetToken(Anope::string &token)
Definition: hashcomp.cpp:99
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: ngircd.cpp:389
IRCDMessageNick message_nick
Definition: ngircd.cpp:617
CoreExport Server * Me
Definition: servers.cpp:24
const Anope::string & Modes() const
Definition: modes.cpp:96
void SetModesInternal(const MessageSource &source, const char *umodes,...)
Definition: users.cpp:645
void SendJoin(User *user, Channel *c, const ChannelStatus *status) anope_override
Definition: ngircd.cpp:90
void SendSVSKillInternal(const MessageSource &source, User *user, const Anope::string &buf) anope_override
Definition: ngircd.cpp:18
Definition: logger.h:53
void SendClientIntroduction(User *u) anope_override
Definition: ngircd.cpp:55
Message::Time message_time
Definition: ngircd.cpp:606
static void SJoin(MessageSource &source, const Anope::string &chan, time_t ts, const Anope::string &modes, const std::list< SJoinUser > &users)
Definition: messages.cpp:97
Message::Invite message_invite
Definition: ngircd.cpp:595
static NickCore * Find(const Anope::string &nick)
Definition: nickcore.cpp:258
Message::Privmsg message_privmsg
Definition: ngircd.cpp:602
iterator begin()
Definition: anope.h:282
size_type find(const string &_str, size_type pos=0) const
Definition: anope.h:192
void SendTopic(const MessageSource &source, Channel *c) anope_override
Definition: ngircd.cpp:150
static BotInfo * Find(const Anope::string &nick, bool nick_only=false)
Definition: bots.cpp:249
IRCDMessageNick(Module *creator)
Definition: ngircd.cpp:415