Anope IRC Services  Version 2.0
messages.cpp
Go to the documentation of this file.
1 /* Common message handlers
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 
13 #include "services.h"
14 #include "modules.h"
15 #include "users.h"
16 #include "protocol.h"
17 #include "config.h"
18 #include "uplink.h"
19 #include "opertype.h"
20 #include "messages.h"
21 #include "servers.h"
22 #include "channels.h"
23 
24 using namespace Message;
25 
26 void Away::Run(MessageSource &source, const std::vector<Anope::string> &params)
27 {
28  FOREACH_MOD(OnUserAway, (source.GetUser(), params.empty() ? "" : params[0]));
29 }
30 
31 void Capab::Run(MessageSource &source, const std::vector<Anope::string> &params)
32 {
33  if (params.size() == 1)
34  {
35  spacesepstream sep(params[0]);
36  Anope::string token;
37  while (sep.GetToken(token))
38  Servers::Capab.insert(token);
39  }
40  else
41  for (unsigned i = 0; i < params.size(); ++i)
42  Servers::Capab.insert(params[i]);
43 }
44 
45 void Error::Run(MessageSource &source, const std::vector<Anope::string> &params)
46 {
47  Log(LOG_TERMINAL) << "ERROR: " << params[0];
48  Anope::QuitReason = "Received ERROR from uplink: " + params[0];
49  Anope::Quitting = true;
50 }
51 
52 void Invite::Run(MessageSource &source, const std::vector<Anope::string> &params)
53 {
54  User *targ = User::Find(params[0]);
55  Channel *c = Channel::Find(params[1]);
56 
57  if (!targ || targ->server != Me || !c || c->FindUser(targ))
58  return;
59 
60  FOREACH_MOD(OnInvite, (source.GetUser(), c, targ));
61 }
62 
63 void Join::Run(MessageSource &source, const std::vector<Anope::string> &params)
64 {
65  User *user = source.GetUser();
66  const Anope::string &channels = params[0];
67 
68  Anope::string channel;
69  commasepstream sep(channels);
70 
71  while (sep.GetToken(channel))
72  {
73  /* Special case for /join 0 */
74  if (channel == "0")
75  {
76  for (User::ChanUserList::iterator it = user->chans.begin(), it_end = user->chans.end(); it != it_end; )
77  {
78  ChanUserContainer *cc = it->second;
79  ++it;
80 
81  Anope::string channame = cc->chan->name;
82  FOREACH_MOD(OnPrePartChannel, (user, cc->chan));
83  cc->chan->DeleteUser(user);
84  FOREACH_MOD(OnPartChannel, (user, Channel::Find(channame), channame, ""));
85  }
86  continue;
87  }
88 
89  std::list<SJoinUser> users;
90  users.push_back(std::make_pair(ChannelStatus(), user));
91 
92  Channel *chan = Channel::Find(channel);
93  SJoin(source, channel, chan ? chan->creation_time : Anope::CurTime, "", users);
94  }
95 }
96 
97 void Join::SJoin(MessageSource &source, const Anope::string &chan, time_t ts, const Anope::string &modes, const std::list<SJoinUser> &users)
98 {
99  bool created;
100  Channel *c = Channel::FindOrCreate(chan, created, ts ? ts : Anope::CurTime);
101  bool keep_their_modes = true;
102 
103  if (created)
104  c->syncing = true;
105  /* Some IRCds do not include a TS */
106  else if (!ts)
107  ;
108  /* Our creation time is newer than what the server gave us, so reset the channel to the older time */
109  else if (c->creation_time > ts)
110  {
111  c->creation_time = ts;
112  c->Reset();
113  }
114  /* Their TS is newer, don't accept any modes from them */
115  else if (ts > c->creation_time)
116  keep_their_modes = false;
117 
118  /* Update the modes for the channel */
119  if (keep_their_modes && !modes.empty())
120  /* If we are syncing, mlock is checked later in Channel::Sync. It is important to not check it here
121  * so that Channel::SetCorrectModes can correctly detect the presence of channel mode +r.
122  */
123  c->SetModesInternal(source, modes, ts, !c->syncing);
124 
125  for (std::list<SJoinUser>::const_iterator it = users.begin(), it_end = users.end(); it != it_end; ++it)
126  {
127  const ChannelStatus &status = it->first;
128  User *u = it->second;
129  keep_their_modes = ts <= c->creation_time; // OnJoinChannel can call modules which can modify this channel's ts
130 
131  if (c->FindUser(u))
132  continue;
133 
134  /* Add the user to the channel */
135  c->JoinUser(u, keep_their_modes ? &status : NULL);
136 
137  /* Check if the user is allowed to join */
138  if (c->CheckKick(u))
139  continue;
140 
141  /* Set whatever modes the user should have, and remove any that
142  * they aren't allowed to have (secureops etc).
143  */
144  c->SetCorrectModes(u, true);
145 
146  FOREACH_MOD(OnJoinChannel, (u, c));
147  }
148 
149  /* Channel is done syncing */
150  if (c->syncing)
151  {
152  /* Sync the channel (mode lock, topic, etc) */
153  /* the channel is synced when the netmerge is complete */
154  Server *src = source.GetServer() ? source.GetServer() : Me;
155  if (src && src->IsSynced())
156  {
157  c->Sync();
158 
159  if (c->CheckDelete())
160  delete c;
161  }
162  }
163 }
164 
165 void Kick::Run(MessageSource &source, const std::vector<Anope::string> &params)
166 {
167  const Anope::string &channel = params[0];
168  const Anope::string &users = params[1];
169  const Anope::string &reason = params.size() > 2 ? params[2] : "";
170 
171  Channel *c = Channel::Find(channel);
172  if (!c)
173  return;
174 
175  Anope::string user;
176  commasepstream sep(users);
177 
178  while (sep.GetToken(user))
179  c->KickInternal(source, user, reason);
180 }
181 
182 void Kill::Run(MessageSource &source, const std::vector<Anope::string> &params)
183 {
184  User *u = User::Find(params[0]);
185  BotInfo *bi;
186 
187  if (!u)
188  return;
189 
190  /* Recover if someone kills us. */
191  if (u->server == Me && (bi = dynamic_cast<BotInfo *>(u)))
192  {
193  static time_t last_time = 0;
194 
195  if (last_time == Anope::CurTime)
196  {
197  Anope::QuitReason = "Kill loop detected. Are Services U:Lined?";
198  Anope::Quitting = true;
199  return;
200  }
201  last_time = Anope::CurTime;
202 
203  bi->OnKill();
204  }
205  else
206  u->KillInternal(source.GetSource(), params[1]);
207 }
208 
209 void Message::Mode::Run(MessageSource &source, const std::vector<Anope::string> &params)
210 {
211  Anope::string buf;
212  for (unsigned i = 1; i < params.size(); ++i)
213  buf += " " + params[i];
214 
215  if (IRCD->IsChannelValid(params[0]))
216  {
217  Channel *c = Channel::Find(params[0]);
218 
219  if (c)
220  c->SetModesInternal(source, buf.substr(1), 0);
221  }
222  else
223  {
224  User *u = User::Find(params[0]);
225 
226  if (u)
227  u->SetModesInternal(source, "%s", buf.substr(1).c_str());
228  }
229 }
230 
231 /* XXX We should cache the file somewhere not open/read/close it on every request */
232 void MOTD::Run(MessageSource &source, const std::vector<Anope::string> &params)
233 {
234  Server *s = Server::Find(params[0]);
235  if (s != Me)
236  return;
237 
238  FILE *f = fopen(Config->GetBlock("serverinfo")->Get<const Anope::string>("motd").c_str(), "r");
239  if (f)
240  {
241  IRCD->SendNumeric(375, source.GetSource(), ":- %s Message of the Day", s->GetName().c_str());
242  char buf[BUFSIZE];
243  while (fgets(buf, sizeof(buf), f))
244  {
245  buf[strlen(buf) - 1] = 0;
246  IRCD->SendNumeric(372, source.GetSource(), ":- %s", buf);
247  }
248  fclose(f);
249  IRCD->SendNumeric(376, source.GetSource(), ":End of /MOTD command.");
250  }
251  else
252  IRCD->SendNumeric(422, source.GetSource(), ":- MOTD file not found! Please contact your IRC administrator.");
253 }
254 
255 void Notice::Run(MessageSource &source, const std::vector<Anope::string> &params)
256 {
257  Anope::string message = params[1];
258 
259  User *u = source.GetUser();
260 
261  /* ignore channel notices */
262  if (!IRCD->IsChannelValid(params[0]))
263  {
264  BotInfo *bi = BotInfo::Find(params[0]);
265  if (!bi)
266  return;
267  FOREACH_MOD(OnBotNotice, (u, bi, message));
268  }
269 }
270 
271 void Part::Run(MessageSource &source, const std::vector<Anope::string> &params)
272 {
273  User *u = source.GetUser();
274  const Anope::string &reason = params.size() > 1 ? params[1] : "";
275 
276  Anope::string channel;
277  commasepstream sep(params[0]);
278 
279  while (sep.GetToken(channel))
280  {
281  Reference<Channel> c = Channel::Find(channel);
282 
283  if (!c || !u->FindChannel(c))
284  continue;
285 
286  Log(u, c, "part") << "Reason: " << (!reason.empty() ? reason : "No reason");
287  FOREACH_MOD(OnPrePartChannel, (u, c));
288  Anope::string ChannelName = c->name;
289  c->DeleteUser(u);
290  FOREACH_MOD(OnPartChannel, (u, c, ChannelName, !reason.empty() ? reason : ""));
291  }
292 }
293 
294 void Ping::Run(MessageSource &source, const std::vector<Anope::string> &params)
295 {
296  IRCD->SendPong(params.size() > 1 ? params[1] : Me->GetSID(), params[0]);
297 }
298 
299 void Privmsg::Run(MessageSource &source, const std::vector<Anope::string> &params)
300 {
301  const Anope::string &receiver = params[0];
302  Anope::string message = params[1];
303 
304  User *u = source.GetUser();
305 
306  if (IRCD->IsChannelValid(receiver))
307  {
308  Channel *c = Channel::Find(receiver);
309  if (c)
310  {
311  FOREACH_MOD(OnPrivmsg, (u, c, message));
312  }
313  }
314  else
315  {
316  /* If a server is specified (nick@server format), make sure it matches
317  * us, and strip it off. */
318  Anope::string botname = receiver;
319  size_t s = receiver.find('@');
320  bool nick_only = false;
321  if (s != Anope::string::npos)
322  {
323  Anope::string servername(receiver.begin() + s + 1, receiver.end());
324  botname = botname.substr(0, s);
325  nick_only = true;
326  if (!servername.equals_ci(Me->GetName()))
327  return;
328  }
329  else if (!IRCD->RequiresID && Config->UseStrictPrivmsg)
330  {
331  BotInfo *bi = BotInfo::Find(receiver);
332  if (!bi)
333  return;
334  Log(LOG_DEBUG) << "Ignored PRIVMSG without @ from " << u->nick;
335  u->SendMessage(bi, _("\"/msg %s\" is no longer supported. Use \"/msg %s@%s\" or \"/%s\" instead."), bi->nick.c_str(), bi->nick.c_str(), Me->GetName().c_str(), bi->nick.c_str());
336  return;
337  }
338 
339  BotInfo *bi = BotInfo::Find(botname, nick_only);
340 
341  if (bi)
342  {
343  if (message[0] == '\1' && message[message.length() - 1] == '\1')
344  {
345  if (message.substr(0, 6).equals_ci("\1PING "))
346  {
347  Anope::string buf = message;
348  buf.erase(buf.begin());
349  buf.erase(buf.end() - 1);
350  IRCD->SendCTCP(bi, u->nick, "%s", buf.c_str());
351  }
352  else if (message.substr(0, 9).equals_ci("\1VERSION\1"))
353  {
355  IRCD->SendCTCP(bi, u->nick, "VERSION Anope-%s %s :%s - (%s) -- %s", Anope::Version().c_str(), Me->GetName().c_str(), IRCD->GetProtocolName().c_str(), enc ? enc->name.c_str() : "(none)", Anope::VersionBuildString().c_str());
356  }
357  return;
358  }
359 
360  EventReturn MOD_RESULT;
361  FOREACH_RESULT(OnBotPrivmsg, MOD_RESULT, (u, bi, message));
362  if (MOD_RESULT == EVENT_STOP)
363  return;
364 
365  bi->OnMessage(u, message);
366  }
367  }
368 
369  return;
370 }
371 
372 void Quit::Run(MessageSource &source, const std::vector<Anope::string> &params)
373 {
374  const Anope::string &reason = params[0];
375  User *user = source.GetUser();
376 
377  Log(user, "quit") << "quit (Reason: " << (!reason.empty() ? reason : "no reason") << ")";
378 
379  user->Quit(reason);
380 }
381 
382 void SQuit::Run(MessageSource &source, const std::vector<Anope::string> &params)
383 {
384  Server *s = Server::Find(params[0]);
385 
386  if (!s)
387  {
388  Log(LOG_DEBUG) << "SQUIT for nonexistent server " << params[0];
389  return;
390  }
391 
392  s->Delete(s->GetName() + " " + s->GetUplink()->GetName());
393 }
394 
395 void Stats::Run(MessageSource &source, const std::vector<Anope::string> &params)
396 {
397  User *u = source.GetUser();
398 
399  switch (params[0][0])
400  {
401  case 'l':
402  if (u->HasMode("OPER"))
403  {
404  IRCD->SendNumeric(211, source.GetSource(), "Server SendBuf SentBytes SentMsgs RecvBuf RecvBytes RecvMsgs ConnTime");
405  IRCD->SendNumeric(211, source.GetSource(), "%s %d %d %d %d %d %d %ld", Config->Uplinks[Anope::CurrentUplink].host.c_str(), UplinkSock->WriteBufferLen(), TotalWritten, -1, UplinkSock->ReadBufferLen(), TotalRead, -1, static_cast<long>(Anope::CurTime - Anope::StartTime));
406  }
407 
408  IRCD->SendNumeric(219, source.GetSource(), "%c :End of /STATS report.", params[0][0]);
409  break;
410  case 'o':
411  case 'O':
412  /* Check whether the user is an operator */
413  if (!u->HasMode("OPER") && Config->GetBlock("options")->Get<bool>("hidestatso"))
414  IRCD->SendNumeric(219, source.GetSource(), "%c :End of /STATS report.", params[0][0]);
415  else
416  {
417  for (unsigned i = 0; i < Oper::opers.size(); ++i)
418  {
419  Oper *o = Oper::opers[i];
420 
421  const NickAlias *na = NickAlias::Find(o->name);
422  if (na)
423  IRCD->SendNumeric(243, source.GetSource(), "O * * %s %s 0", o->name.c_str(), o->ot->GetName().c_str());
424  }
425 
426  IRCD->SendNumeric(219, source.GetSource(), "%c :End of /STATS report.", params[0][0]);
427  }
428 
429  break;
430  case 'u':
431  {
432  time_t uptime = Anope::CurTime - Anope::StartTime;
433  IRCD->SendNumeric(242, source.GetSource(), ":Services up %d day%s, %02d:%02d:%02d", uptime / 86400, uptime / 86400 == 1 ? "" : "s", (uptime / 3600) % 24, (uptime / 60) % 60, uptime % 60);
434  IRCD->SendNumeric(250, source.GetSource(), ":Current users: %d (%d ops); maximum %d", UserListByNick.size(), OperCount, MaxUserCount);
435  IRCD->SendNumeric(219, source.GetSource(), "%c :End of /STATS report.", params[0][0]);
436  break;
437  } /* case 'u' */
438 
439  default:
440  IRCD->SendNumeric(219, source.GetSource(), "%c :End of /STATS report.", params[0][0]);
441  }
442 
443  return;
444 }
445 
446 void Time::Run(MessageSource &source, const std::vector<Anope::string> &params)
447 {
448  time_t t;
449  time(&t);
450  struct tm *tm = localtime(&t);
451  char buf[64];
452  strftime(buf, sizeof(buf), "%a %b %d %H:%M:%S %Y %Z", tm);
453  IRCD->SendNumeric(391, source.GetSource(), "%s :%s", Me->GetName().c_str(), buf);
454  return;
455 }
456 
457 void Topic::Run(MessageSource &source, const std::vector<Anope::string> &params)
458 {
459  Channel *c = Channel::Find(params[0]);
460  if (c)
461  c->ChangeTopicInternal(source.GetSource(), params[1], Anope::CurTime);
462 
463  return;
464 }
465 
466 void Version::Run(MessageSource &source, const std::vector<Anope::string> &params)
467 {
469  IRCD->SendNumeric(351, source.GetSource(), "Anope-%s %s :%s -(%s) -- %s", Anope::Version().c_str(), Me->GetName().c_str(), IRCD->GetProtocolName().c_str(), enc ? enc->name.c_str() : "(none)", Anope::VersionBuildString().c_str());
470 }
471 
472 void Whois::Run(MessageSource &source, const std::vector<Anope::string> &params)
473 {
474  User *u = User::Find(params[0]);
475 
476  if (u && u->server == Me)
477  {
478  const BotInfo *bi = BotInfo::Find(u->GetUID());
479  IRCD->SendNumeric(311, source.GetSource(), "%s %s %s * :%s", u->nick.c_str(), u->GetIdent().c_str(), u->host.c_str(), u->realname.c_str());
480  if (bi)
481  IRCD->SendNumeric(307, source.GetSource(), "%s :is a registered nick", bi->nick.c_str());
482  IRCD->SendNumeric(312, source.GetSource(), "%s %s :%s", u->nick.c_str(), Me->GetName().c_str(), Config->GetBlock("serverinfo")->Get<const Anope::string>("description").c_str());
483  if (bi)
484  IRCD->SendNumeric(317, source.GetSource(), "%s %ld %ld :seconds idle, signon time", bi->nick.c_str(), static_cast<long>(Anope::CurTime - bi->lastmsg), static_cast<long>(bi->signon));
485  IRCD->SendNumeric(318, source.GetSource(), "%s :End of /WHOIS list.", u->nick.c_str());
486  }
487  else
488  IRCD->SendNumeric(401, source.GetSource(), "%s :No such user.", params[0].c_str());
489 }
490 
Definition: bots.h:24
bool HasMode(const Anope::string &name) const
Definition: users.cpp:513
static NickAlias * Find(const Anope::string &nick)
Definition: nickalias.cpp:121
ChanUserContainer * JoinUser(User *u, const ChannelStatus *status)
Definition: channels.cpp:140
Definition: servers.h:42
Anope::string name
Definition: modules.h:221
const Anope::string & GetIdent() const
Definition: users.cpp:264
bool IsSynced() const
Definition: servers.cpp:298
time_t signon
Definition: users.h:79
void DeleteUser(User *u)
Definition: channels.cpp:154
Definition: opertype.h:18
CoreExport time_t StartTime
Definition: main.cpp:40
void Reset()
Definition: channels.cpp:68
void Quit(const Anope::string &reason="")
Definition: users.cpp:749
virtual void SendCTCP(const MessageSource &source, const Anope::string &dest, const char *fmt,...)
Definition: protocol.cpp:329
time_t lastmsg
Definition: bots.h:31
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:209
CoreExport string Version()
Definition: misc.cpp:625
CoreExport std::set< Anope::string > Capab
Definition: servers.cpp:29
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:271
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:63
const Anope::string & GetSID() const
Definition: servers.cpp:203
ChanUserList chans
Definition: users.h:87
void OnKill()
Definition: bots.cpp:126
#define BUFSIZE
Definition: services.h:18
time_t creation_time
Definition: channels.h:48
const Anope::string & GetProtocolName()
Definition: protocol.cpp:43
const Anope::string & GetName() const
Definition: opertype.cpp:113
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:26
Definition: users.h:34
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:232
CoreExport unsigned MaxUserCount
Definition: users.cpp:31
ChanUserContainer * FindChannel(Channel *c) const
Definition: users.cpp:716
Anope::string name
Definition: opertype.h:21
#define FOREACH_RESULT(ename, ret, args)
Definition: modules.h:95
bool equals_ci(const char *_str) const
Definition: anope.h:78
static Channel * FindOrCreate(const Anope::string &name, bool &created, time_t ts=Anope::CurTime)
Definition: channels.cpp:929
const Anope::string & GetSource() const
Definition: protocol.cpp:473
virtual void OnMessage(User *u, const Anope::string &message)
Definition: bots.cpp:223
bool RequiresID
Definition: protocol.h:69
Anope::string name
Definition: channels.h:44
CoreExport time_t CurTime
Definition: main.cpp:41
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:299
#define FOREACH_MOD(ename, args)
Definition: modules.h:62
iterator erase(const iterator &i)
Definition: anope.h:155
Channel * chan
Definition: channels.h:26
bool CheckKick(User *user)
Definition: channels.cpp:890
string substr(size_type pos=0, size_type n=npos) const
Definition: anope.h:277
static std::vector< Oper * > opers
Definition: opertype.h:35
size_type length() const
Definition: anope.h:131
CoreExport bool Quitting
Definition: main.cpp:34
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:255
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:382
Definition: Config.cs:26
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:446
OperType * ot
Definition: opertype.h:23
Server * GetServer() const
Definition: protocol.cpp:488
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:45
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:31
static const size_type npos
Definition: anope.h:44
const Anope::string & GetUID() const
Definition: users.cpp:230
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:372
void ChangeTopicInternal(const Anope::string &user, const Anope::string &newtopic, time_t ts=Anope::CurTime)
Definition: channels.cpp:786
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:395
void KickInternal(const MessageSource &source, const Anope::string &nick, const Anope::string &reason)
Definition: channels.cpp:730
virtual void SendNumeric(int numeric, const Anope::string &dest, const char *fmt,...)
Definition: protocol.cpp:339
static Anope::map< std::pair< bool, Anope::string > > modes
Definition: cs_mode.cpp:745
User * GetUser() const
Definition: protocol.cpp:478
bool empty() const
Definition: anope.h:126
Anope::string host
Definition: users.h:65
void SetCorrectModes(User *u, bool give_modes)
Definition: channels.cpp:816
void SetModesInternal(MessageSource &source, const Anope::string &mode, time_t ts=0, bool enforce_mlock=true)
Definition: channels.cpp:595
static Server * Find(const Anope::string &name, bool name_only=false)
Definition: servers.cpp:337
void KillInternal(const MessageSource &source, const Anope::string &reason)
Definition: users.cpp:736
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:165
CoreExport IRCDProto * IRCD
Definition: protocol.cpp:23
EventReturn
Definition: modules.h:129
bool CheckDelete()
Definition: channels.cpp:122
Server * server
Definition: users.h:77
ChanUserContainer * FindUser(User *u) const
Definition: channels.cpp:173
static Module * FindFirstOf(ModType type)
CoreExport string VersionBuildString()
Definition: misc.cpp:639
CoreExport int CurrentUplink
Definition: main.cpp:43
Anope::string realname
Definition: users.h:71
CoreExport uint32_t TotalWritten
Definition: sockets.cpp:27
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
const Anope::string & GetName() const
Definition: servers.cpp:175
bool syncing
Definition: channels.h:50
CoreExport uint32_t TotalRead
Definition: sockets.cpp:26
iterator end()
Definition: anope.h:284
static Channel * Find(const Anope::string &name)
Definition: channels.cpp:920
bool GetToken(Anope::string &token)
Definition: hashcomp.cpp:99
int WriteBufferLen() const
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:294
CoreExport Server * Me
Definition: servers.cpp:24
CoreExport user_map UserListByNick
Definition: users.cpp:28
void SetModesInternal(const MessageSource &source, const char *umodes,...)
Definition: users.cpp:645
const char * c_str() const
Definition: anope.h:117
Definition: logger.h:53
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
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:52
CoreExport Anope::string strftime(time_t t, const NickCore *nc=NULL, bool short_output=false)
Definition: misc.cpp:356
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:457
iterator begin()
Definition: anope.h:282
void SendMessage(BotInfo *source, const char *fmt,...)
Definition: users.cpp:320
size_type find(const string &_str, size_type pos=0) const
Definition: anope.h:192
void Sync()
Definition: channels.cpp:98
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:472
#define _(x)
Definition: services.h:50
CoreExport Anope::string QuitReason
Definition: main.cpp:36
static BotInfo * Find(const Anope::string &nick, bool nick_only=false)
Definition: bots.cpp:249
CoreExport int OperCount
Definition: users.cpp:30
virtual void SendPong(const Anope::string &servname, const Anope::string &who)
Definition: protocol.cpp:276
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:466
int ReadBufferLen() const
void Run(MessageSource &source, const std::vector< Anope::string > &params) anope_override
Definition: messages.cpp:182
void Delete(const Anope::string &reason)
Definition: servers.cpp:167
Server * GetUplink()
Definition: servers.cpp:221