Anope IRC Services  Version 2.0
nickserv.cpp
Go to the documentation of this file.
1 /* NickServ core 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 
16 class NickServCollide : public Timer
17 {
20  time_t ts;
22 
23  public:
24  NickServCollide(Module *me, NickServService *nss, User *user, NickAlias *nick, time_t delay) : Timer(me, delay), service(nss), u(user), ts(user->timestamp), na(nick)
25  {
26  }
27 
28  void Tick(time_t t) anope_override
29  {
30  if (!u || !na)
31  return;
32  /* If they identified or don't exist anymore, don't kill them. */
33  if (u->Account() == na->nc || u->timestamp > ts)
34  return;
35 
36  service->Collide(u, na);
37  }
38 };
39 
42 class NickServHeld : public Timer
43 {
46  public:
47  NickServHeld(Module *me, NickAlias *n, long l) : Timer(me, l), na(n), nick(na->nick)
48  {
49  n->Extend<bool>("HELD");
50  }
51 
52  void Tick(time_t)
53  {
54  if (na)
55  na->Shrink<bool>("HELD");
56  }
57 };
58 
61 
64 class NickServRelease : public User, public Timer
65 {
67 
68  public:
69  NickServRelease(Module *me, NickAlias *na, time_t delay) : User(na->nick, Config->GetModule("nickserv")->Get<const Anope::string>("enforceruser", "user"),
70  Config->GetModule("nickserv")->Get<const Anope::string>("enforcerhost", "services.localhost.net"), "", "", Me, "Services Enforcer", Anope::CurTime, "", IRCD->UID_Retrieve(), NULL), Timer(me, delay), nick(na->nick)
71  {
72  /* Erase the current release timer and use the new one */
73  Anope::map<NickServRelease *>::iterator nit = NickServReleases.find(this->nick);
74  if (nit != NickServReleases.end())
75  {
76  IRCD->SendQuit(nit->second, "");
77  delete nit->second;
78  }
79 
80  NickServReleases.insert(std::make_pair(this->nick, this));
81 
83  }
84 
86  {
87  IRCD->SendQuit(this, "");
88  NickServReleases.erase(this->nick);
89  }
90 
91  void Tick(time_t t) anope_override { }
92 };
93 
94 class NickServCore : public Module, public NickServService
95 {
97  std::vector<Anope::string> defaults;
99 
100  void OnCancel(User *u, NickAlias *na)
101  {
102  if (collided.HasExt(na))
103  {
104  collided.Unset(na);
105 
106  new NickServHeld(this, na, Config->GetModule("nickserv")->Get<time_t>("releasetimeout", "1m"));
107 
108  if (IRCD->CanSVSHold)
109  IRCD->SendSVSHold(na->nick, Config->GetModule("nickserv")->Get<time_t>("releasetimeout", "1m"));
110  else
111  new NickServRelease(this, na, Config->GetModule("nickserv")->Get<time_t>("releasetimeout", "1m"));
112  }
113  }
114 
115  public:
116  NickServCore(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, PSEUDOCLIENT | VENDOR),
117  NickServService(this), held(this, "HELD"), collided(this, "COLLIDED")
118  {
119  }
120 
122  {
123  OnShutdown();
124  }
125 
127  {
128  /* On shutdown, restart, or mod unload, remove all of our holds for nicks (svshold or qlines)
129  * because some IRCds do not allow us to have these automatically expire
130  */
131  for (nickalias_map::const_iterator it = NickAliasList->begin(); it != NickAliasList->end(); ++it)
132  this->Release(it->second);
133  }
134 
136  {
137  OnShutdown();
138  }
139 
141  {
142  NickAlias *na = NickAlias::Find(u->nick);
143  if (!na)
144  return;
145 
146  EventReturn MOD_RESULT;
147  FOREACH_RESULT(OnNickValidate, MOD_RESULT, (u, na));
148  if (MOD_RESULT == EVENT_STOP)
149  {
150  this->Collide(u, na);
151  return;
152  }
153  else if (MOD_RESULT == EVENT_ALLOW)
154  return;
155 
156  if (!na->nc->HasExt("NS_SECURE") && u->IsRecognized())
157  {
159  na->last_usermask = u->GetIdent() + "@" + u->GetDisplayedHost();
160  na->last_realname = u->realname;
161  return;
162  }
163 
164  if (Config->GetModule("nickserv")->Get<bool>("nonicknameownership"))
165  return;
166 
167  bool on_access = u->IsRecognized(false);
168 
169  if (on_access || !na->nc->HasExt("KILL_IMMED"))
170  {
171  if (na->nc->HasExt("NS_SECURE"))
172  u->SendMessage(NickServ, NICK_IS_SECURE, Config->StrictPrivmsg.c_str(), NickServ->nick.c_str());
173  else
174  u->SendMessage(NickServ, NICK_IS_REGISTERED, Config->StrictPrivmsg.c_str(), NickServ->nick.c_str());
175  }
176  if (na->nc->HasExt("KILLPROTECT") && !on_access)
177  {
178  if (na->nc->HasExt("KILL_IMMED"))
179  {
180  u->SendMessage(NickServ, FORCENICKCHANGE_NOW);
181  this->Collide(u, na);
182  }
183  else if (na->nc->HasExt("KILL_QUICK"))
184  {
185  time_t killquick = Config->GetModule("nickserv")->Get<time_t>("killquick", "20s");
186  u->SendMessage(NickServ, _("If you do not change within %s, I will change your nick."), Anope::Duration(killquick, u->Account()).c_str());
187  new NickServCollide(this, this, u, na, killquick);
188  }
189  else
190  {
191  time_t kill = Config->GetModule("nickserv")->Get<time_t>("kill", "60s");
192  u->SendMessage(NickServ, _("If you do not change within %s, I will change your nick."), Anope::Duration(kill, u->Account()).c_str());
193  new NickServCollide(this, this, u, na, kill);
194  }
195  }
196 
197  }
198 
200  {
201  NickAlias *na = NickAlias::Find(u->nick);
202  if (na && *na->nc == u->Account() && !Config->GetModule("nickserv")->Get<bool>("nonicknameownership") && !na->nc->HasExt("UNCONFIRMED"))
203  u->SetMode(NickServ, "REGISTERED");
204 
205  const Anope::string &modesonid = Config->GetModule(this)->Get<Anope::string>("modesonid");
206  if (!modesonid.empty())
207  u->SetModes(NickServ, "%s", modesonid.c_str());
208  }
209 
211  {
212  if (na)
213  collided.Set(na);
214 
215  if (IRCD->CanSVSNick)
216  {
217  unsigned nicklen = Config->GetBlock("networkinfo")->Get<unsigned>("nicklen");
218  const Anope::string &guestprefix = Config->GetModule("nickserv")->Get<const Anope::string>("guestnickprefix", "Guest");
219 
220  Anope::string guestnick;
221 
222  int i = 0;
223  do
224  {
225  guestnick = guestprefix + stringify(static_cast<uint16_t>(rand()));
226  if (guestnick.length() > nicklen)
227  guestnick = guestnick.substr(0, nicklen);
228  }
229  while (User::Find(guestnick) && i++ < 10);
230 
231  if (i == 11)
232  u->Kill(NickServ ? NickServ->nick : "", "Services nickname-enforcer kill");
233  else
234  {
235  if (NickServ)
236  u->SendMessage(NickServ, _("Your nickname is now being changed to \002%s\002"), guestnick.c_str());
237  IRCD->SendForceNickChange(u, guestnick, Anope::CurTime);
238  }
239  }
240  else
241  u->Kill(NickServ ? NickServ->nick : "", "Services nickname-enforcer kill");
242  }
243 
245  {
246  if (held.HasExt(na))
247  {
248  if (IRCD->CanSVSHold)
249  IRCD->SendSVSHoldDel(na->nick);
250  else
251  {
252  User *u = User::Find(na->nick);
253  if (u && u->server == Me)
254  {
255  u->Quit();
256  }
257  }
258 
259  held.Unset(na);
260  }
261  }
262 
264  {
265  const Anope::string &nsnick = conf->GetModule(this)->Get<const Anope::string>("client");
266 
267  if (nsnick.empty())
268  throw ConfigException(Module::name + ": <client> must be defined");
269 
270  BotInfo *bi = BotInfo::Find(nsnick, true);
271  if (!bi)
272  throw ConfigException(Module::name + ": no bot named " + nsnick);
273 
274  NickServ = bi;
275 
276  spacesepstream(conf->GetModule(this)->Get<const Anope::string>("defaults", "ns_secure memo_signon memo_receive")).GetTokens(defaults);
277  if (defaults.empty())
278  {
279  defaults.push_back("NS_SECURE");
280  defaults.push_back("MEMO_SIGNON");
281  defaults.push_back("MEMO_RECEIVE");
282  }
283  else if (defaults[0].equals_ci("none"))
284  defaults.clear();
285  }
286 
288  {
289  User *u = User::Find(na->nick);
290  if (u && u->Account() == na->nc)
291  {
292  IRCD->SendLogout(u);
293  u->RemoveMode(NickServ, "REGISTERED");
294  u->Logout();
295  }
296  }
297 
299  {
300  Log(NickServ, "nick") << "Deleting nickname group " << nc->display;
301 
302  /* Clean up this nick core from any users online */
303  for (std::list<User *>::iterator it = nc->users.begin(); it != nc->users.end();)
304  {
305  User *user = *it++;
306  IRCD->SendLogout(user);
307  user->RemoveMode(NickServ, "REGISTERED");
308  user->Logout();
309  FOREACH_MOD(OnNickLogout, (user));
310  }
311  nc->users.clear();
312  }
313 
315  {
316  Log(LOG_NORMAL, "nick", NickServ) << "Changing " << nc->display << " nickname group display to " << newdisplay;
317  }
318 
320  {
321  Configuration::Block *block = Config->GetModule(this);
322 
323  if (block->Get<bool>("modeonid", "yes"))
324 
325  for (User::ChanUserList::iterator it = u->chans.begin(), it_end = u->chans.end(); it != it_end; ++it)
326  {
327  ChanUserContainer *cc = it->second;
328  Channel *c = cc->chan;
329  if (c)
330  c->SetCorrectModes(u, true);
331  }
332 
333  const Anope::string &modesonid = block->Get<const Anope::string>("modesonid");
334  if (!modesonid.empty())
335  u->SetModes(NickServ, "%s", modesonid.c_str());
336 
337  if (block->Get<bool>("forceemail", "yes") && u->Account()->email.empty())
338  {
339  u->SendMessage(NickServ, _("You must now supply an e-mail for your nick.\n"
340  "This e-mail will allow you to retrieve your password in\n"
341  "case you forget it."));
342  u->SendMessage(NickServ, _("Type \002%s%s SET EMAIL \037e-mail\037\002 in order to set your e-mail.\n"
343  "Your privacy is respected; this e-mail won't be given to\n"
344  "any third-party person."), Config->StrictPrivmsg.c_str(), NickServ->nick.c_str());
345  }
346  }
347 
349  {
350  if (!target->nc->HasExt("UNCONFIRMED"))
351  u->SetMode(NickServ, "REGISTERED");
352  }
353 
355  {
356  for (User::ChanUserList::iterator it = u->chans.begin(), it_end = u->chans.end(); it != it_end; ++it)
357  {
358  ChanUserContainer *cc = it->second;
359  Channel *c = cc->chan;
360  if (c)
361  c->SetCorrectModes(u, true);
362  }
363  }
364 
365  void OnUserConnect(User *u, bool &exempt) anope_override
366  {
367  if (u->Quitting() || !u->server->IsSynced() || u->server->IsULined())
368  return;
369 
370  const NickAlias *na = NickAlias::Find(u->nick);
371 
372  const Anope::string &unregistered_notice = Config->GetModule(this)->Get<const Anope::string>("unregistered_notice");
373  if (!Config->GetModule("nickserv")->Get<bool>("nonicknameownership") && !unregistered_notice.empty() && !na && !u->Account())
374  u->SendMessage(NickServ, unregistered_notice);
375  else if (na && !u->IsIdentified(true))
376  this->Validate(u);
377  }
378 
380  {
381  NickAlias *na = NickAlias::Find(u->nick);
382  if (na)
383  OnCancel(u, na);
384  }
385 
387  {
388  for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)
389  {
390  User *u = it->second;
391 
392  if (u->server == s)
393  {
394  if (u->HasMode("REGISTERED") && !u->IsIdentified(true))
395  u->RemoveMode(NickServ, "REGISTERED");
396  if (!u->IsIdentified())
397  this->Validate(u);
398  }
399  }
400  }
401 
403  {
404  NickAlias *old_na = NickAlias::Find(oldnick), *na = NickAlias::Find(u->nick);
405  /* If the new nick isn't registered or it's registered and not yours */
406  if (!na || na->nc != u->Account())
407  {
408  /* Remove +r, but keep an account associated with the user */
409  u->RemoveMode(NickServ, "REGISTERED");
410 
411  this->Validate(u);
412  }
413  else
414  {
415  /* Reset +r and re-send account (even though it really should be set at this point) */
416  IRCD->SendLogin(u, na);
417  if (!Config->GetModule("nickserv")->Get<bool>("nonicknameownership") && na->nc == u->Account() && !na->nc->HasExt("UNCONFIRMED"))
418  u->SetMode(NickServ, "REGISTERED");
419  Log(NickServ) << u->GetMask() << " automatically identified for group " << u->Account()->display;
420  }
421 
422  if (!u->nick.equals_ci(oldnick) && old_na)
423  OnCancel(u, old_na);
424  }
425 
426  void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) anope_override
427  {
428  if (u->server->IsSynced() && mname == "REGISTERED" && !u->IsIdentified(true))
429  u->RemoveMode(NickServ, mname);
430  }
431 
432  EventReturn OnPreHelp(CommandSource &source, const std::vector<Anope::string> &params) anope_override
433  {
434  if (!params.empty() || source.c || source.service != *NickServ)
435  return EVENT_CONTINUE;
436  if (!Config->GetModule("nickserv")->Get<bool>("nonicknameownership"))
437  source.Reply(_("\002%s\002 allows you to register a nickname and\n"
438  "prevent others from using it. The following\n"
439  "commands allow for registration and maintenance of\n"
440  "nicknames; to use them, type \002%s%s \037command\037\002.\n"
441  "For more information on a specific command, type\n"
442  "\002%s%s %s \037command\037\002.\n"), NickServ->nick.c_str(), Config->StrictPrivmsg.c_str(), NickServ->nick.c_str(), Config->StrictPrivmsg.c_str(), NickServ->nick.c_str(), source.command.c_str());
443  else
444  source.Reply(_("\002%s\002 allows you to register an account.\n"
445  "The following commands allow for registration and maintenance of\n"
446  "accounts; to use them, type \002%s%s \037command\037\002.\n"
447  "For more information on a specific command, type\n"
448  "\002%s%s %s \037command\037\002.\n"), NickServ->nick.c_str(), Config->StrictPrivmsg.c_str(), NickServ->nick.c_str(), Config->StrictPrivmsg.c_str(), NickServ->nick.c_str(), source.command.c_str());
449  return EVENT_CONTINUE;
450  }
451 
452  void OnPostHelp(CommandSource &source, const std::vector<Anope::string> &params) anope_override
453  {
454  if (!params.empty() || source.c || source.service != *NickServ)
455  return;
456  if (source.IsServicesOper())
457  source.Reply(_(" \n"
458  "Services Operators can also drop any nickname without needing\n"
459  "to identify for the nick, and may view the access list for\n"
460  "any nickname."));
461  time_t nickserv_expire = Config->GetModule(this)->Get<time_t>("expire", "21d");
462  if (nickserv_expire >= 86400)
463  source.Reply(_(" \n"
464  "Accounts that are not used anymore are subject to\n"
465  "the automatic expiration, i.e. they will be deleted\n"
466  "after %d days if not used."), nickserv_expire / 86400);
467  source.Reply(_(" \n"
468  "\002NOTICE:\002 This service is intended to provide a way for\n"
469  "IRC users to ensure their identity is not compromised.\n"
470  "It is \002NOT\002 intended to facilitate \"stealing\" of\n"
471  "nicknames or other malicious actions. Abuse of %s\n"
472  "will result in, at minimum, loss of the abused\n"
473  "nickname(s)."), NickServ->nick.c_str());
474  }
475 
477  {
478  /* Set default flags */
479  for (unsigned i = 0; i < defaults.size(); ++i)
480  nc->Extend<bool>(defaults[i].upper());
481  }
482 
483  void OnUserQuit(User *u, const Anope::string &msg)
484  {
485  if (u->server && !u->server->GetQuitReason().empty() && Config->GetModule(this)->Get<bool>("hidenetsplitquit"))
486  return;
487 
488  /* Update last quit and last seen for the user */
489  NickAlias *na = NickAlias::Find(u->nick);
490  if (na && !na->nc->HasExt("NS_SUSPENDED") && (u->IsRecognized() || u->IsIdentified(true)))
491  {
493  na->last_quit = msg;
494  }
495  }
496 
498  {
500  return;
501 
502  time_t nickserv_expire = Config->GetModule(this)->Get<time_t>("expire", "21d");
503 
504  for (nickalias_map::const_iterator it = NickAliasList->begin(), it_end = NickAliasList->end(); it != it_end; )
505  {
506  NickAlias *na = it->second;
507  ++it;
508 
509  User *u = User::Find(na->nick);
510  if (u && (u->IsIdentified(true) || u->IsRecognized()))
512 
513  bool expire = false;
514 
515  if (nickserv_expire && Anope::CurTime - na->last_seen >= nickserv_expire)
516  expire = true;
517 
518  FOREACH_MOD(OnPreNickExpire, (na, expire));
519 
520  if (expire)
521  {
522  Log(LOG_NORMAL, "nickserv/expire", NickServ) << "Expiring nickname " << na->nick << " (group: " << na->nc->display << ") (e-mail: " << (na->nc->email.empty() ? "none" : na->nc->email) << ")";
523  FOREACH_MOD(OnNickExpire, (na));
524  delete na;
525  }
526  }
527  }
528 
529  void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) anope_override
530  {
531  if (!na->nc->HasExt("UNCONFIRMED"))
532  {
533  time_t nickserv_expire = Config->GetModule(this)->Get<time_t>("expire", "21d");
534  if (!na->HasExt("NS_NO_EXPIRE") && nickserv_expire && !Anope::NoExpire && (source.HasPriv("nickserv/auspex") || na->last_seen != Anope::CurTime))
535  info[_("Expires")] = Anope::strftime(na->last_seen + nickserv_expire, source.GetAccount());
536  }
537  else
538  {
539  time_t unconfirmed_expire = Config->GetModule(this)->Get<time_t>("unconfirmedexpire", "1d");
540  info[_("Expires")] = Anope::strftime(na->time_registered + unconfirmed_expire, source.GetAccount());
541  }
542  }
543 };
544 
546 
Reference< NickAlias > na
Definition: nickserv.cpp:44
Serialize::Reference< NickCore > nc
Definition: account.h:47
Definition: bots.h:24
bool HasMode(const Anope::string &name) const
Definition: users.cpp:513
CoreExport bool ReadOnly
Definition: main.cpp:28
static NickAlias * Find(const Anope::string &nick)
Definition: nickalias.cpp:121
Definition: servers.h:42
Anope::string name
Definition: modules.h:221
#define NICK_IS_REGISTERED
Definition: language.h:91
virtual void OnPreNickExpire(NickAlias *na, bool &expire)
Definition: modules.h:520
Definition: timers.h:18
void OnReload(Configuration::Conf *conf) anope_override
Definition: nickserv.cpp:263
ExtensibleItem< bool > collided
Definition: nickserv.cpp:98
bool IsRecognized(bool check_secure=true) const
Definition: users.cpp:438
virtual void SendSVSHoldDel(const Anope::string &)
Definition: protocol.h:207
void OnUserQuit(User *u, const Anope::string &msg)
Definition: nickserv.cpp:483
void Quit(const Anope::string &reason="")
Definition: users.cpp:749
Anope::string nick
Definition: account.h:37
NickServService * service
Definition: nickserv.cpp:18
EventReturn OnPreHelp(CommandSource &source, const std::vector< Anope::string > &params) anope_override
Definition: nickserv.cpp:432
Anope::string last_usermask
Definition: account.h:41
void OnDelCore(NickCore *nc) anope_override
Definition: nickserv.cpp:298
void GetTokens(T &token)
Definition: anope.h:587
virtual void SendLogout(User *u)=0
void OnRestart() anope_override
Definition: nickserv.cpp:135
Definition: users.h:34
T * Extend(const Anope::string &name, const T &what)
Definition: extensible.h:224
void Release(NickAlias *na) anope_override
Definition: nickserv.cpp:244
void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) anope_override
Definition: nickserv.cpp:529
void OnPostHelp(CommandSource &source, const std::vector< Anope::string > &params) anope_override
Definition: nickserv.cpp:452
void Tick(time_t)
Definition: nickserv.cpp:52
#define FOREACH_RESULT(ename, ret, args)
Definition: modules.h:95
void OnNickCoreCreate(NickCore *nc)
Definition: nickserv.cpp:476
void OnCancel(User *u, NickAlias *na)
Definition: nickserv.cpp:100
Reference< BotInfo > NickServ
Definition: nickserv.cpp:96
void Unset(Extensible *obj) anope_override
Definition: extensible.h:95
void OnNickGroup(User *u, NickAlias *target) anope_override
Definition: nickserv.cpp:348
virtual void SendQuit(User *u, const char *fmt,...)
Definition: protocol.cpp:252
CoreExport time_t CurTime
Definition: main.cpp:41
void OnExpireTick() anope_override
Definition: nickserv.cpp:497
#define FOREACH_MOD(ename, args)
Definition: modules.h:62
NickServCollide(Module *me, NickServService *nss, User *user, NickAlias *nick, time_t delay)
Definition: nickserv.cpp:24
CoreExport Serialize::Checker< nickalias_map > NickAliasList
void OnUserLogin(User *u) anope_override
Definition: nickserv.cpp:199
Channel * chan
Definition: channels.h:26
static Module * me
Definition: bs_kick.cpp:18
NickServRelease(Module *me, NickAlias *na, time_t delay)
Definition: nickserv.cpp:69
ExtensibleItem< bool > held
Definition: nickserv.cpp:98
virtual void SendForceNickChange(User *u, const Anope::string &newnick, time_t when)
Definition: protocol.cpp:324
time_t timestamp
Definition: users.h:81
Definition: Config.cs:26
bool CanSVSNick
Definition: protocol.h:49
void Shrink(const Anope::string &name)
Definition: extensible.h:253
virtual void OnNickExpire(NickAlias *na)
Definition: modules.h:525
void Collide(User *u, NickAlias *na) anope_override
Definition: nickserv.cpp:210
const Anope::string & GetQuitReason() const
Definition: servers.cpp:211
T * Set(Extensible *obj, const T &value)
Definition: extensible.h:78
void OnNickUpdate(User *u) anope_override
Definition: nickserv.cpp:354
bool IsIdentified(bool check_nick=false) const
Definition: users.cpp:427
void OnNickIdentify(User *u) anope_override
Definition: nickserv.cpp:319
void OnUserModeSet(const MessageSource &setter, User *u, const Anope::string &mname) anope_override
Definition: nickserv.cpp:426
virtual EventReturn OnNickValidate(User *u, NickAlias *na)
Definition: modules.h:1078
virtual void SendSVSHold(const Anope::string &, time_t)
Definition: protocol.h:206
NickServCore(const Anope::string &modname, const Anope::string &creator)
Definition: nickserv.cpp:116
void OnServerSync(Server *s) anope_override
Definition: nickserv.cpp:386
void Validate(User *u) anope_override
Definition: nickserv.cpp:140
#define anope_override
Definition: services.h:56
bool empty() const
Definition: anope.h:126
void Tick(time_t t) anope_override
Definition: nickserv.cpp:91
void SetCorrectModes(User *u, bool give_modes)
Definition: channels.cpp:816
void Logout()
Definition: users.cpp:408
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
#define MODULE_INIT(x)
Definition: modules.h:45
Server * server
Definition: users.h:77
Reference< User > u
Definition: nickserv.cpp:19
Anope::string nick
Definition: nickserv.cpp:66
void Tick(time_t t) anope_override
Definition: nickserv.cpp:28
bool CanSVSHold
Definition: protocol.h:63
Anope::string stringify(const T &x)
Definition: anope.h:710
void RemoveMode(BotInfo *bi, UserMode *um, const Anope::string &param="")
Definition: users.cpp:587
void OnPostUserLogoff(User *u) anope_override
Definition: nickserv.cpp:379
virtual void SendLogin(User *u, NickAlias *na)=0
virtual void Collide(User *u, NickAlias *na)=0
static Anope::map< NickServRelease * > NickServReleases
Definition: nickserv.cpp:59
CoreExport bool NoExpire
Definition: main.cpp:28
void OnChangeCoreDisplay(NickCore *nc, const Anope::string &newdisplay) anope_override
Definition: nickserv.cpp:314
Anope::string nick
Definition: users.h:62
static User * Find(const Anope::string &name, bool nick_only=false)
Definition: users.cpp:815
time_t last_seen
Definition: account.h:45
NickCore * Account() const
Definition: users.cpp:422
virtual void SendClientIntroduction(User *u)=0
CoreExport Server * Me
Definition: servers.cpp:24
CoreExport user_map UserListByNick
Definition: users.cpp:28
Anope::string last_realname
Definition: account.h:39
const char * c_str() const
Definition: anope.h:117
Definition: logger.h:53
void OnDelNick(NickAlias *na) anope_override
Definition: nickserv.cpp:287
#define NICK_IS_SECURE
Definition: language.h:93
T Get(const Anope::string &tag)
Definition: config.h:44
CoreExport Anope::string Duration(time_t seconds, const NickCore *nc=NULL)
Definition: misc.cpp:315
void OnShutdown() anope_override
Definition: nickserv.cpp:126
Anope::string last_quit
Definition: account.h:38
void OnUserNickChange(User *u, const Anope::string &oldnick) anope_override
Definition: nickserv.cpp:402
CoreExport Anope::string strftime(time_t t, const NickCore *nc=NULL, bool short_output=false)
Definition: misc.cpp:356
Anope::string nick
Definition: nickserv.cpp:45
bool HasExt(const Extensible *obj) const
Definition: extensible.h:111
NickServHeld(Module *me, NickAlias *n, long l)
Definition: nickserv.cpp:47
virtual void OnNickLogout(User *u)
Definition: modules.h:741
#define _(x)
Definition: services.h:50
static BotInfo * Find(const Anope::string &nick, bool nick_only=false)
Definition: bots.cpp:249
Reference< NickAlias > na
Definition: nickserv.cpp:21
Definition: anope.h:20
std::vector< Anope::string > defaults
Definition: nickserv.cpp:97
#define FORCENICKCHANGE_NOW
Definition: language.h:96
void OnUserConnect(User *u, bool &exempt) anope_override
Definition: nickserv.cpp:365