Anope IRC Services  Version 2.0
regchannel.cpp
Go to the documentation of this file.
1 /* Registered channel 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 
13 #include "services.h"
14 #include "modules.h"
15 #include "regchannel.h"
16 #include "account.h"
17 #include "access.h"
18 #include "channels.h"
19 #include "config.h"
20 #include "bots.h"
21 #include "servers.h"
22 
24 
26 {
27 }
28 
30 {
31  if (this->ci)
32  {
33  std::vector<AutoKick *>::iterator it = std::find(this->ci->akick->begin(), this->ci->akick->end(), this);
34  if (it != this->ci->akick->end())
35  this->ci->akick->erase(it);
36 
37  const NickAlias *na = NickAlias::Find(this->mask);
38  if (na != NULL)
39  na->nc->RemoveChannelReference(this->ci);
40  }
41 }
42 
44 {
45  data["ci"] << this->ci->name;
46  if (this->nc)
47  data["nc"] << this->nc->display;
48  else
49  data["mask"] << this->mask;
50  data["reason"] << this->reason;
51  data["creator"] << this->creator;
52  data.SetType("addtime", Serialize::Data::DT_INT); data["addtime"] << this->addtime;
53  data.SetType("last_used", Serialize::Data::DT_INT); data["last_used"] << this->last_used;
54 }
55 
57 {
58  Anope::string sci, snc;
59 
60  data["ci"] >> sci;
61  data["nc"] >> snc;
62 
64  if (!ci)
65  return NULL;
66 
67  AutoKick *ak;
68  NickCore *nc = NickCore::Find(snc);
69  if (obj)
70  {
72  data["creator"] >> ak->creator;
73  data["reason"] >> ak->reason;
74  ak->nc = NickCore::Find(snc);
75  data["mask"] >> ak->mask;
76  data["addtime"] >> ak->addtime;
77  data["last_used"] >> ak->last_used;
78  }
79  else
80  {
81  time_t addtime, lastused;
82  data["addtime"] >> addtime;
83  data["last_used"] >> lastused;
84 
85  Anope::string screator, sreason, smask;
86 
87  data["creator"] >> screator;
88  data["reason"] >> sreason;
89  data["mask"] >> smask;
90 
91  if (nc)
92  ak = ci->AddAkick(screator, nc, sreason, addtime, lastused);
93  else
94  ak = ci->AddAkick(screator, smask, sreason, addtime, lastused);
95  }
96 
97  return ak;
98 }
99 
100 ChannelInfo::ChannelInfo(const Anope::string &chname) : Serializable("ChannelInfo"),
101  access("ChanAccess"), akick("AutoKick")
102 {
103  if (chname.empty())
104  throw CoreException("Empty channel passed to ChannelInfo constructor");
105 
106  this->founder = NULL;
107  this->successor = NULL;
108  this->c = Channel::Find(chname);
109  if (this->c)
110  this->c->ci = this;
111  this->banexpire = 0;
112  this->bi = NULL;
113  this->last_topic_time = 0;
114 
115  this->name = chname;
116 
117  this->bantype = 2;
118  this->memos.memomax = 0;
119  this->last_used = this->time_registered = Anope::CurTime;
120 
121  size_t old = RegisteredChannelList->size();
122  (*RegisteredChannelList)[this->name] = this;
123  if (old == RegisteredChannelList->size())
124  Log(LOG_DEBUG) << "Duplicate channel " << this->name << " in registered channel table?";
125 
126  FOREACH_MOD(OnCreateChan, (this));
127 }
128 
130  access("ChanAccess"), akick("AutoKick")
131 {
132  *this = ci;
133 
134  if (this->founder)
135  --this->founder->channelcount;
136 
137  this->access->clear();
138  this->akick->clear();
139 
140  for (unsigned i = 0; i < ci.GetAccessCount(); ++i)
141  {
142  const ChanAccess *taccess = ci.GetAccess(i);
143  AccessProvider *provider = taccess->provider;
144 
145  ChanAccess *newaccess = provider->Create();
146  newaccess->SetMask(taccess->Mask(), this);
147  newaccess->creator = taccess->creator;
148  newaccess->last_seen = taccess->last_seen;
149  newaccess->created = taccess->created;
150  newaccess->AccessUnserialize(taccess->AccessSerialize());
151 
152  this->AddAccess(newaccess);
153  }
154 
155  for (unsigned i = 0; i < ci.GetAkickCount(); ++i)
156  {
157  const AutoKick *takick = ci.GetAkick(i);
158  if (takick->nc)
159  this->AddAkick(takick->creator, takick->nc, takick->reason, takick->addtime, takick->last_used);
160  else
161  this->AddAkick(takick->creator, takick->mask, takick->reason, takick->addtime, takick->last_used);
162  }
163 
164  FOREACH_MOD(OnCreateChan, (this));
165 }
166 
168 {
169  FOREACH_MOD(OnDelChan, (this));
170 
171  Log(LOG_DEBUG) << "Deleting channel " << this->name;
172 
173  if (this->c)
174  {
175  if (this->bi && this->c->FindUser(this->bi))
176  this->bi->Part(this->c);
177 
178  /* Parting the service bot can cause the channel to go away */
179 
180  if (this->c)
181  {
182  if (this->c && this->c->CheckDelete())
183  delete this->c;
184 
185  this->c = NULL;
186  }
187  }
188 
189  RegisteredChannelList->erase(this->name);
190 
191  this->SetFounder(NULL);
192  this->SetSuccessor(NULL);
193 
194  this->ClearAccess();
195  this->ClearAkick();
196 
197  if (!this->memos.memos->empty())
198  {
199  for (unsigned i = 0, end = this->memos.memos->size(); i < end; ++i)
200  delete this->memos.GetMemo(i);
201  this->memos.memos->clear();
202  }
203 
204  if (this->founder)
205  --this->founder->channelcount;
206 }
207 
209 {
210  data["name"] << this->name;
211  if (this->founder)
212  data["founder"] << this->founder->display;
213  if (this->successor)
214  data["successor"] << this->successor->display;
215  data["description"] << this->desc;
216  data.SetType("time_registered", Serialize::Data::DT_INT); data["time_registered"] << this->time_registered;
217  data.SetType("last_used", Serialize::Data::DT_INT); data["last_used"] << this->last_used;
218  data["last_topic"] << this->last_topic;
219  data["last_topic_setter"] << this->last_topic_setter;
220  data.SetType("last_topic_time", Serialize::Data::DT_INT); data["last_topic_time"] << this->last_topic_time;
221  data.SetType("bantype", Serialize::Data::DT_INT); data["bantype"] << this->bantype;
222  {
223  Anope::string levels_buffer;
224  for (Anope::map<int16_t>::const_iterator it = this->levels.begin(), it_end = this->levels.end(); it != it_end; ++it)
225  levels_buffer += it->first + " " + stringify(it->second) + " ";
226  data["levels"] << levels_buffer;
227  }
228  if (this->bi)
229  data["bi"] << this->bi->nick;
230  data.SetType("banexpire", Serialize::Data::DT_INT); data["banexpire"] << this->banexpire;
231  data["memomax"] << this->memos.memomax;
232  for (unsigned i = 0; i < this->memos.ignores.size(); ++i)
233  data["memoignores"] << this->memos.ignores[i] << " ";
234 
235  Extensible::ExtensibleSerialize(this, this, data);
236 }
237 
239 {
240  Anope::string sname, sfounder, ssuccessor, slevels, sbi;
241 
242  data["name"] >> sname;
243  data["founder"] >> sfounder;
244  data["successor"] >> ssuccessor;
245  data["levels"] >> slevels;
246  data["bi"] >> sbi;
247 
248  ChannelInfo *ci;
249  if (obj)
251  else
252  ci = new ChannelInfo(sname);
253 
254  ci->SetFounder(NickCore::Find(sfounder));
255  ci->SetSuccessor(NickCore::Find(ssuccessor));
256 
257  data["description"] >> ci->desc;
258  data["time_registered"] >> ci->time_registered;
259  data["last_used"] >> ci->last_used;
260  data["last_topic"] >> ci->last_topic;
261  data["last_topic_setter"] >> ci->last_topic_setter;
262  data["last_topic_time"] >> ci->last_topic_time;
263  data["bantype"] >> ci->bantype;
264  {
265  std::vector<Anope::string> v;
266  spacesepstream(slevels).GetTokens(v);
267  for (unsigned i = 0; i + 1 < v.size(); i += 2)
268  try
269  {
270  ci->levels[v[i]] = convertTo<int16_t>(v[i + 1]);
271  }
272  catch (const ConvertException &) { }
273  }
274  BotInfo *bi = BotInfo::Find(sbi, true);
275  if (*ci->bi != bi)
276  {
277  if (bi)
278  bi->Assign(NULL, ci);
279  else if (ci->bi)
280  ci->bi->UnAssign(NULL, ci);
281  }
282  data["banexpire"] >> ci->banexpire;
283  data["memomax"] >> ci->memos.memomax;
284  {
285  Anope::string buf;
286  data["memoignores"] >> buf;
287  spacesepstream sep(buf);
288  ci->memos.ignores.clear();
289  while (sep.GetToken(buf))
290  ci->memos.ignores.push_back(buf);
291  }
292 
293  Extensible::ExtensibleUnserialize(ci, ci, data);
294 
295  /* compat */
296  bool b;
297  b = false;
298  data["extensible:SECURE"] >> b;
299  if (b)
300  ci->Extend<bool>("CS_SECURE");
301  b = false;
302  data["extensible:PRIVATE"] >> b;
303  if (b)
304  ci->Extend<bool>("CS_PRIVATE");
305  b = false;
306  data["extensible:NO_EXPIRE"] >> b;
307  if (b)
308  ci->Extend<bool>("CS_NO_EXPIRE");
309  b = false;
310  data["extensible:FANTASY"] >> b;
311  if (b)
312  ci->Extend<bool>("BS_FANTASY");
313  b = false;
314  data["extensible:GREET"] >> b;
315  if (b)
316  ci->Extend<bool>("BS_GREET");
317  b = false;
318  data["extensible:PEACE"] >> b;
319  if (b)
320  ci->Extend<bool>("PEACE");
321  b = false;
322  data["extensible:SECUREFOUNDER"] >> b;
323  if (b)
324  ci->Extend<bool>("SECUREFOUNDER");
325  b = false;
326  data["extensible:RESTRICTED"] >> b;
327  if (b)
328  ci->Extend<bool>("RESTRICTED");
329  b = false;
330  data["extensible:KEEPTOPIC"] >> b;
331  if (b)
332  ci->Extend<bool>("KEEPTOPIC");
333  b = false;
334  data["extensible:SIGNKICK"] >> b;
335  if (b)
336  ci->Extend<bool>("SIGNKICK");
337  b = false;
338  data["extensible:SIGNKICK_LEVEL"] >> b;
339  if (b)
340  ci->Extend<bool>("SIGNKICK_LEVEL");
341  /* end compat */
342 
343  return ci;
344 }
345 
346 
348 {
349  if (this->founder)
350  {
351  --this->founder->channelcount;
352  this->founder->RemoveChannelReference(this);
353  }
354 
355  this->founder = nc;
356 
357  if (this->founder)
358  {
359  ++this->founder->channelcount;
360  this->founder->AddChannelReference(this);
361  }
362 }
363 
365 {
366  return this->founder;
367 }
368 
370 {
371  if (this->successor)
372  this->successor->RemoveChannelReference(this);
373  this->successor = nc;
374  if (this->successor)
375  this->successor->AddChannelReference(this);
376 }
377 
379 {
380  return this->successor;
381 }
382 
384 {
385  if (this && this->bi)
386  return this->bi;
387 
388  BotInfo *ChanServ = Config->GetClient("ChanServ");
389  if (ChanServ)
390  return ChanServ;
391 
392  if (!BotListByNick->empty())
393  return BotListByNick->begin()->second;
394 
395  return NULL;
396 }
397 
399 {
400  this->access->push_back(taccess);
401 }
402 
403 ChanAccess *ChannelInfo::GetAccess(unsigned index) const
404 {
405  if (this->access->empty() || index >= this->access->size())
406  return NULL;
407 
408  ChanAccess *acc = (*this->access)[index];
409  acc->QueueUpdate();
410  return acc;
411 }
412 
414 {
415  AccessGroup group;
416 
417  if (u == NULL)
418  return group;
419 
420  const NickCore *nc = u->Account();
421  if (nc == NULL && !this->HasExt("NS_SECURE") && u->IsRecognized())
422  {
423  const NickAlias *na = NickAlias::Find(u->nick);
424  if (na != NULL)
425  nc = na->nc;
426  }
427 
428  group.super_admin = u->super_admin;
429  group.founder = IsFounder(u, this);
430  group.ci = this;
431  group.nc = nc;
432 
433  for (unsigned i = 0, end = this->GetAccessCount(); i < end; ++i)
434  {
435  ChanAccess *a = this->GetAccess(i);
436  if (a->Matches(u, u->Account(), group.path))
437  group.push_back(a);
438  }
439 
440  if (group.founder || !group.empty())
441  {
442  this->last_used = Anope::CurTime;
443 
444  for (unsigned i = 0; i < group.size(); ++i)
445  group[i]->last_seen = Anope::CurTime;
446  }
447 
448  return group;
449 }
450 
452 {
453  AccessGroup group;
454 
455  group.founder = (this->founder && this->founder == nc);
456  group.ci = this;
457  group.nc = nc;
458 
459  for (unsigned i = 0, end = this->GetAccessCount(); i < end; ++i)
460  {
461  ChanAccess *a = this->GetAccess(i);
462  if (a->Matches(NULL, nc, group.path))
463  group.push_back(a);
464  }
465 
466  if (group.founder || !group.empty())
467  this->last_used = Anope::CurTime;
468 
469  /* don't update access last seen here, this isn't the user requesting access */
470 
471  return group;
472 }
473 
475 {
476  return this->access->size();
477 }
478 
480 {
481  ChanAccess::Path path;
482  for (unsigned i = 0, end = this->GetAccessCount(); i < end; ++i)
483  {
484  ChanAccess *a = this->GetAccess(i);
485  a->Matches(NULL, NULL, path);
486  }
487 
488  unsigned count = this->GetAccessCount();
489  std::set<const ChannelInfo *> channels;
490  channels.insert(this);
491  for (ChanAccess::Set::iterator it = path.first.begin(); it != path.first.end(); ++it)
492  {
493  const ChannelInfo *ci = it->first->ci;
494  if (!channels.count(ci))
495  {
496  channels.count(ci);
497  count += ci->GetAccessCount();
498  }
499  }
500  return count;
501 }
502 
504 {
505  if (this->access->empty() || index >= this->access->size())
506  return NULL;
507 
508  ChanAccess *ca = this->access->at(index);
509  this->access->erase(this->access->begin() + index);
510  return ca;
511 }
512 
514 {
515  for (unsigned i = this->access->size(); i > 0; --i)
516  delete this->GetAccess(i - 1);
517 }
518 
519 AutoKick *ChannelInfo::AddAkick(const Anope::string &user, NickCore *akicknc, const Anope::string &reason, time_t t, time_t lu)
520 {
521  AutoKick *autokick = new AutoKick();
522  autokick->ci = this;
523  autokick->nc = akicknc;
524  autokick->reason = reason;
525  autokick->creator = user;
526  autokick->addtime = t;
527  autokick->last_used = lu;
528 
529  this->akick->push_back(autokick);
530 
531  akicknc->AddChannelReference(this);
532 
533  return autokick;
534 }
535 
536 AutoKick *ChannelInfo::AddAkick(const Anope::string &user, const Anope::string &mask, const Anope::string &reason, time_t t, time_t lu)
537 {
538  AutoKick *autokick = new AutoKick();
539  autokick->ci = this;
540  autokick->mask = mask;
541  autokick->nc = NULL;
542  autokick->reason = reason;
543  autokick->creator = user;
544  autokick->addtime = t;
545  autokick->last_used = lu;
546 
547  this->akick->push_back(autokick);
548 
549  return autokick;
550 }
551 
552 AutoKick *ChannelInfo::GetAkick(unsigned index) const
553 {
554  if (this->akick->empty() || index >= this->akick->size())
555  return NULL;
556 
557  AutoKick *ak = (*this->akick)[index];
558  ak->QueueUpdate();
559  return ak;
560 }
561 
563 {
564  return this->akick->size();
565 }
566 
567 void ChannelInfo::EraseAkick(unsigned index)
568 {
569  if (this->akick->empty() || index >= this->akick->size())
570  return;
571 
572  delete this->GetAkick(index);
573 }
574 
576 {
577  while (!this->akick->empty())
578  delete this->akick->back();
579 }
580 
581 int16_t ChannelInfo::GetLevel(const Anope::string &priv) const
582 {
583  if (PrivilegeManager::FindPrivilege(priv) == NULL)
584  {
585  Log(LOG_DEBUG) << "Unknown privilege " + priv;
586  return ACCESS_INVALID;
587  }
588 
589  Anope::map<int16_t>::const_iterator it = this->levels.find(priv);
590  if (it == this->levels.end())
591  return 0;
592  return it->second;
593 }
594 
595 void ChannelInfo::SetLevel(const Anope::string &priv, int16_t level)
596 {
597  this->levels[priv] = level;
598 }
599 
601 {
602  this->levels.erase(priv);
603 }
604 
606 {
607  this->levels.clear();
608 }
609 
611 {
612  int bt = this ? this->bantype : -1;
613  switch (bt)
614  {
615  case 0:
616  return "*!" + u->GetVIdent() + "@" + u->GetDisplayedHost();
617  case 1:
618  if (u->GetVIdent()[0] == '~')
619  return "*!*" + u->GetVIdent() + "@" + u->GetDisplayedHost();
620  else
621  return "*!" + u->GetVIdent() + "@" + u->GetDisplayedHost();
622  case 3:
623  return "*!" + u->Mask();
624  case 2:
625  default:
626  return "*!*@" + u->GetDisplayedHost();
627  }
628 }
629 
631 {
632  registered_channel_map::const_iterator it = RegisteredChannelList->find(name);
633  if (it != RegisteredChannelList->end())
634  {
635  it->second->QueueUpdate();
636  return it->second;
637  }
638 
639  return NULL;
640 }
641 
642 bool IsFounder(const User *user, const ChannelInfo *ci)
643 {
644  if (!user || !ci)
645  return false;
646 
647  if (user->super_admin)
648  return true;
649 
650  if (user->Account() && user->Account() == ci->GetFounder())
651  return true;
652 
653  return false;
654 }
655 
656 
658 {
659  ++references[what];
660 }
661 
663 {
664  int &i = references[what];
665  if (--i <= 0)
666  references.erase(what);
667 }
668 
669 void ChannelInfo::GetChannelReferences(std::deque<Anope::string> &chans)
670 {
671  chans.clear();
672  for (Anope::map<int>::iterator it = references.begin(); it != references.end(); ++it)
673  chans.push_back(it->first);
674 }
Serialize::Reference< NickCore > nc
Definition: account.h:47
Definition: bots.h:24
static NickAlias * Find(const Anope::string &nick)
Definition: nickalias.cpp:121
std::pair< Set, Set > Path
Definition: access.h:87
const ChannelInfo * ci
Definition: access.h:144
time_t banexpire
Definition: regchannel.h:84
void EraseAkick(unsigned index)
Definition: regchannel.cpp:567
Definition: hashcomp.h:84
unsigned GetAkickCount() const
Definition: regchannel.cpp:562
static Serializable * Unserialize(Serializable *obj, Serialize::Data &)
Definition: regchannel.cpp:238
Anope::string name
Definition: regchannel.h:63
bool IsRecognized(bool check_secure=true) const
Definition: users.cpp:438
Anope::string GetIdealBan(User *u) const
Definition: regchannel.cpp:610
void Assign(User *u, ChannelInfo *ci)
Definition: bots.cpp:153
Anope::string desc
Definition: regchannel.h:64
void GetTokens(T &token)
Definition: anope.h:587
time_t last_topic_time
Definition: regchannel.h:71
Anope::map< int > references
Definition: regchannel.h:51
void QueueUpdate()
Definition: serialize.cpp:83
Definition: users.h:34
Anope::string creator
Definition: access.h:93
virtual Anope::string AccessSerialize() const =0
unsigned GetDeepAccessCount() const
Definition: regchannel.cpp:479
Anope::string Mask() const
Definition: users.cpp:768
time_t created
Definition: access.h:95
void SetLevel(const Anope::string &priv, int16_t level)
Definition: regchannel.cpp:595
bool founder
Definition: access.h:150
NickCore * GetSuccessor() const
Definition: regchannel.cpp:378
Serialize::Reference< ChannelInfo > ci
Definition: channels.h:46
virtual void SetType(const Anope::string &key, Type t)
Definition: serialize.h:38
CoreExport time_t CurTime
Definition: main.cpp:41
bool super_admin
Definition: access.h:150
virtual void AccessUnserialize(const Anope::string &data)=0
void AddChannelReference(const Anope::string &what)
Definition: regchannel.cpp:657
#define FOREACH_MOD(ename, args)
Definition: modules.h:62
Serialize::Reference< NickCore > successor
Definition: regchannel.h:54
void RemoveLevel(const Anope::string &priv)
Definition: regchannel.cpp:600
static Privilege * FindPrivilege(const Anope::string &name)
Definition: access.cpp:105
static ChannelInfo * Find(const Anope::string &name)
Definition: regchannel.cpp:630
BotInfo * WhoSends() const
Definition: regchannel.cpp:383
int16_t bantype
Definition: regchannel.h:75
void SetSuccessor(NickCore *nc)
Definition: regchannel.cpp:369
NickCore * GetFounder() const
Definition: regchannel.cpp:364
void Serialize(Serialize::Data &data) const anope_override
Definition: regchannel.cpp:43
Serialize::Reference< ChannelInfo > ci
Definition: regchannel.h:30
Definition: Config.cs:26
Channel * c
Definition: regchannel.h:79
time_t last_seen
Definition: access.h:94
ChanAccess * EraseAccess(unsigned index)
Definition: regchannel.cpp:503
std::vector< Anope::string > ignores
Definition: memo.h:44
const Anope::string & GetDisplayedHost() const
Definition: users.cpp:203
Anope::string reason
Definition: regchannel.h:35
time_t last_used
Definition: regchannel.h:67
time_t last_used
Definition: regchannel.h:38
CoreExport Serialize::Checker< botinfo_map > BotListByNick
Serialize::Checker< std::vector< ChanAccess * > > access
Definition: regchannel.h:55
const Anope::string & Mask() const
Definition: access.cpp:196
void SetFounder(NickCore *nc)
Definition: regchannel.cpp:347
static void ExtensibleUnserialize(Extensible *, Serializable *, Serialize::Data &data)
Definition: extensible.cpp:50
Memo * GetMemo(unsigned index) const
Definition: memos.cpp:82
virtual ChanAccess * Create()=0
unsigned GetAccessCount() const
Definition: regchannel.cpp:474
const Anope::string & GetVIdent() const
Definition: users.cpp:247
bool empty() const
Definition: anope.h:126
Serialize::Checker< registered_channel_map > RegisteredChannelList("ChannelInfo")
void AddChannelReference(ChannelInfo *ci)
Definition: nickcore.cpp:239
void AddAccess(ChanAccess *access)
Definition: regchannel.cpp:398
Anope::string last_topic_setter
Definition: regchannel.h:70
Serialize::Checker< std::vector< AutoKick * > > akick
Definition: regchannel.h:56
MemoInfo memos
Definition: regchannel.h:77
Anope::string creator
Definition: regchannel.h:36
AccessProvider * provider
Definition: access.h:90
bool CheckDelete()
Definition: channels.cpp:122
ChanUserContainer * FindUser(User *u) const
Definition: channels.cpp:173
AutoKick * GetAkick(unsigned index) const
Definition: regchannel.cpp:552
void Serialize(Serialize::Data &data) const anope_override
Definition: regchannel.cpp:208
AccessGroup AccessFor(const User *u)
Definition: regchannel.cpp:413
int16_t memomax
Definition: memo.h:42
Anope::string stringify(const T &x)
Definition: anope.h:710
Anope::string last_topic
Definition: regchannel.h:69
virtual bool Matches(const User *u, const NickCore *nc, Path &p) const
Definition: access.cpp:254
Anope::map< int16_t > levels
Definition: regchannel.h:57
Anope::string nick
Definition: users.h:62
Serialize::Checker< std::vector< Memo * > > memos
Definition: memo.h:43
void GetChannelReferences(std::deque< Anope::string > &chans)
Definition: regchannel.cpp:669
Anope::string mask
Definition: regchannel.h:32
Serialize::Reference< NickCore > nc
Definition: regchannel.h:33
Serialize::Reference< NickCore > founder
Definition: regchannel.h:53
NickCore * Account() const
Definition: users.cpp:422
static Channel * Find(const Anope::string &name)
Definition: channels.cpp:920
bool GetToken(Anope::string &token)
Definition: hashcomp.cpp:99
T anope_dynamic_static_cast(O ptr)
Definition: anope.h:774
int16_t GetLevel(const Anope::string &priv) const
Definition: regchannel.cpp:581
Anope::string name
Definition: access.cpp:22
void ClearLevels()
Definition: regchannel.cpp:605
Definition: logger.h:53
const NickCore * nc
Definition: access.h:148
ChanAccess::Path path
Definition: access.h:146
ChannelInfo(const Anope::string &chname)
Definition: regchannel.cpp:100
void SetMask(const Anope::string &mask, ChannelInfo *ci)
Definition: access.cpp:165
AutoKick * AddAkick(const Anope::string &user, NickCore *akicknc, const Anope::string &reason, time_t t=Anope::CurTime, time_t lu=0)
Definition: regchannel.cpp:519
static Serializable * Unserialize(Serializable *obj, Serialize::Data &)
Definition: regchannel.cpp:56
void ClearAccess()
Definition: regchannel.cpp:513
Serialize::Reference< BotInfo > bi
Definition: regchannel.h:82
bool super_admin
Definition: users.h:83
static NickCore * Find(const Anope::string &nick)
Definition: nickcore.cpp:258
void RemoveChannelReference(const Anope::string &what)
Definition: regchannel.cpp:662
bool IsFounder(const User *user, const ChannelInfo *ci)
Definition: regchannel.cpp:642
friend class AutoKick
Definition: regchannel.h:61
time_t addtime
Definition: regchannel.h:37
static void ExtensibleSerialize(const Extensible *, const Serializable *, Serialize::Data &data)
Definition: extensible.cpp:41
static BotInfo * Find(const Anope::string &nick, bool nick_only=false)
Definition: bots.cpp:249
bool HasExt(const Anope::string &name) const
Definition: extensible.cpp:31
time_t time_registered
Definition: regchannel.h:66
ChanAccess * GetAccess(unsigned index) const
Definition: regchannel.cpp:403
void ClearAkick()
Definition: regchannel.cpp:575