2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2009-2010 Daniel De Graaf <danieldg@inspircd.org>
5 * Copyright (C) 2006-2008 Robin Burchell <robin+git@viroteck.net>
6 * Copyright (C) 2006, 2008 Oliver Lupton <oliverlupton@gmail.com>
7 * Copyright (C) 2008 Pippijn van Steenhoven <pip88nl@gmail.com>
8 * Copyright (C) 2003-2008 Craig Edwards <craigedwards@brainbox.cc>
9 * Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
10 * Copyright (C) 2007 Dennis Friis <peavey@inspircd.org>
12 * This file is part of InspIRCd. InspIRCd is free software: you can
13 * redistribute it and/or modify it under the terms of the GNU General Public
14 * License as published by the Free Software Foundation, version 2.
16 * This program is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <http://www.gnu.org/licenses/>.
33 ChanModeReference ban(NULL, "ban");
34 ChanModeReference inviteonlymode(NULL, "inviteonly");
35 ChanModeReference keymode(NULL, "key");
36 ChanModeReference limitmode(NULL, "limit");
37 ChanModeReference secretmode(NULL, "secret");
38 ChanModeReference privatemode(NULL, "private");
39 UserModeReference invisiblemode(NULL, "invisible");
42 Channel::Channel(const std::string &cname, time_t ts)
43 : name(cname), age(ts), topicset(0)
45 if (!ServerInstance->chanlist.insert(std::make_pair(cname, this)).second)
46 throw CoreException("Cannot create duplicate channel " + cname);
49 void Channel::SetMode(ModeHandler* mh, bool on)
51 modes[mh->GetId()] = on;
54 void Channel::SetTopic(User* u, const std::string& ntopic)
56 this->topic.assign(ntopic, 0, ServerInstance->Config->Limits.MaxTopic);
57 this->setby.assign(ServerInstance->Config->FullHostInTopic ? u->GetFullHost() : u->nick, 0, 128);
58 this->WriteChannel(u, "TOPIC %s :%s", this->name.c_str(), this->topic.c_str());
59 this->topicset = ServerInstance->Time();
61 FOREACH_MOD(OnPostTopicChange, (u, this, this->topic));
64 Membership* Channel::AddUser(User* user)
66 Membership*& memb = userlist[user];
70 memb = new Membership(user, this);
74 void Channel::DelUser(User* user)
76 UserMembIter it = userlist.find(user);
77 if (it != userlist.end())
81 void Channel::CheckDestroy()
83 if (!userlist.empty())
87 FIRST_MOD_RESULT(OnChannelPreDelete, res, (this));
88 if (res == MOD_RES_DENY)
91 chan_hash::iterator iter = ServerInstance->chanlist.find(this->name);
93 if (iter != ServerInstance->chanlist.end())
95 FOREACH_MOD(OnChannelDelete, (this));
96 ServerInstance->chanlist.erase(iter);
100 ServerInstance->GlobalCulls.AddItem(this);
103 void Channel::DelUser(const UserMembIter& membiter)
105 Membership* memb = membiter->second;
108 userlist.erase(membiter);
110 // If this channel became empty then it should be removed
114 Membership* Channel::GetUser(User* user)
116 UserMembIter i = userlist.find(user);
117 if (i == userlist.end())
122 void Channel::SetDefaultModes()
124 ServerInstance->Logs->Log("CHANNELS", LOG_DEBUG, "SetDefaultModes %s",
125 ServerInstance->Config->DefaultModes.c_str());
126 irc::spacesepstream list(ServerInstance->Config->DefaultModes);
128 std::string parameter;
130 list.GetToken(modeseq);
132 for (std::string::iterator n = modeseq.begin(); n != modeseq.end(); ++n)
134 ModeHandler* mode = ServerInstance->Modes->FindMode(*n, MODETYPE_CHANNEL);
137 if (mode->IsPrefixMode())
140 if (mode->GetNumParams(true))
141 list.GetToken(parameter);
145 mode->OnModeChange(ServerInstance->FakeClient, ServerInstance->FakeClient, this, parameter, true);
151 * add a channel to a user, creating the record for it if needed and linking
152 * it to the user record
154 Channel* Channel::JoinUser(LocalUser* user, std::string cname, bool override, const std::string& key)
156 if (user->registered != REG_ALL)
158 ServerInstance->Logs->Log("CHANNELS", LOG_DEBUG, "Attempted to join unregistered user " + user->uuid + " to channel " + cname);
163 * We don't restrict the number of channels that remote users or users that are override-joining may be in.
164 * We restrict local users to <connect:maxchans> channels.
165 * We restrict local operators to <oper:maxchans> channels.
166 * This is a lot more logical than how it was formerly. -- w00t
170 unsigned int maxchans = user->GetClass()->maxchans;
173 unsigned int opermaxchans = ConvToInt(user->oper->getConfig("maxchans"));
174 // If not set, use 2.0's <channels:opers>, if that's not set either, use limit from CC
176 opermaxchans = ServerInstance->Config->OperMaxChans;
178 maxchans = opermaxchans;
180 if (user->chans.size() >= maxchans)
182 user->WriteNumeric(ERR_TOOMANYCHANNELS, "%s :You are on too many channels", cname.c_str());
187 // Crop channel name if it's too long
188 if (cname.length() > ServerInstance->Config->Limits.ChanMax)
189 cname.resize(ServerInstance->Config->Limits.ChanMax);
191 Channel* chan = ServerInstance->FindChan(cname);
192 bool created_by_local = (chan == NULL); // Flag that will be passed to modules in the OnUserJoin() hook later
193 std::string privs; // Prefix mode(letter)s to give to the joining user
197 privs = ServerInstance->Config->DefaultModes.substr(0, ServerInstance->Config->DefaultModes.find(' '));
199 if (override == false)
201 // Ask the modules whether they're ok with the join, pass NULL as Channel* as the channel is yet to be created
202 ModResult MOD_RESULT;
203 FIRST_MOD_RESULT(OnUserPreJoin, MOD_RESULT, (user, NULL, cname, privs, key));
204 if (MOD_RESULT == MOD_RES_DENY)
205 return NULL; // A module wasn't happy with the join, abort
208 chan = new Channel(cname, ServerInstance->Time());
209 // Set the default modes on the channel (<options:defaultmodes>)
210 chan->SetDefaultModes();
214 /* Already on the channel */
215 if (chan->HasUser(user))
218 if (override == false)
220 ModResult MOD_RESULT;
221 FIRST_MOD_RESULT(OnUserPreJoin, MOD_RESULT, (user, chan, cname, privs, key));
223 // A module explicitly denied the join and (hopefully) generated a message
224 // describing the situation, so we may stop here without sending anything
225 if (MOD_RESULT == MOD_RES_DENY)
228 // If no module returned MOD_RES_DENY or MOD_RES_ALLOW (which is the case
229 // most of the time) then proceed to check channel modes +k, +i, +l and bans,
231 // If a module explicitly allowed the join (by returning MOD_RES_ALLOW),
232 // then this entire section is skipped
233 if (MOD_RESULT == MOD_RES_PASSTHRU)
235 std::string ckey = chan->GetModeParameter(keymode);
236 bool invited = user->IsInvited(chan);
237 bool can_bypass = ServerInstance->Config->InvBypassModes && invited;
241 FIRST_MOD_RESULT(OnCheckKey, MOD_RESULT, (user, chan, key));
242 if (!MOD_RESULT.check((ckey == key) || can_bypass))
244 // If no key provided, or key is not the right one, and can't bypass +k (not invited or option not enabled)
245 user->WriteNumeric(ERR_BADCHANNELKEY, "%s :Cannot join channel (Incorrect channel key)", chan->name.c_str());
250 if (chan->IsModeSet(inviteonlymode))
252 FIRST_MOD_RESULT(OnCheckInvite, MOD_RESULT, (user, chan));
253 if (!MOD_RESULT.check(invited))
255 user->WriteNumeric(ERR_INVITEONLYCHAN, "%s :Cannot join channel (Invite only)", chan->name.c_str());
260 std::string limit = chan->GetModeParameter(limitmode);
263 FIRST_MOD_RESULT(OnCheckLimit, MOD_RESULT, (user, chan));
264 if (!MOD_RESULT.check((chan->GetUserCounter() < atol(limit.c_str()) || can_bypass)))
266 user->WriteNumeric(ERR_CHANNELISFULL, "%s :Cannot join channel (Channel is full)", chan->name.c_str());
271 if (chan->IsBanned(user) && !can_bypass)
273 user->WriteNumeric(ERR_BANNEDFROMCHAN, "%s :Cannot join channel (You're banned)", chan->name.c_str());
278 * If the user has invites for this channel, remove them now
279 * after a successful join so they don't build up.
283 user->RemoveInvite(chan);
289 // We figured that this join is allowed and also created the
290 // channel if it didn't exist before, now do the actual join
291 chan->ForceJoin(user, &privs, false, created_by_local);
295 void Channel::ForceJoin(User* user, const std::string* privs, bool bursting, bool created_by_local)
299 ServerInstance->Logs->Log("CHANNELS", LOG_DEBUG, "Attempted to join server user " + user->uuid + " to channel " + this->name);
303 Membership* memb = this->AddUser(user);
305 return; // Already on the channel
307 user->chans.push_front(memb);
311 // If the user was granted prefix modes (in the OnUserPreJoin hook, or he's a
312 // remote user and his own server set the modes), then set them internally now
313 for (std::string::const_iterator i = privs->begin(); i != privs->end(); ++i)
315 PrefixMode* mh = ServerInstance->Modes->FindPrefixMode(*i);
318 std::string nick = user->nick;
319 // Set the mode on the user
320 mh->OnModeChange(ServerInstance->FakeClient, NULL, this, nick, true);
325 // Tell modules about this join, they have the chance now to populate except_list with users we won't send the JOIN (and possibly MODE) to
327 FOREACH_MOD(OnUserJoin, (memb, bursting, created_by_local, except_list));
329 this->WriteAllExcept(user, false, 0, except_list, "JOIN :%s", this->name.c_str());
331 /* Theyre not the first ones in here, make sure everyone else sees the modes we gave the user */
332 if ((GetUserCounter() > 1) && (!memb->modes.empty()))
334 std::string ms = memb->modes;
335 for(unsigned int i=0; i < memb->modes.length(); i++)
336 ms.append(" ").append(user->nick);
338 except_list.insert(user);
339 this->WriteAllExcept(user, !ServerInstance->Config->CycleHostsFromUser, 0, except_list, "MODE %s +%s", this->name.c_str(), ms.c_str());
346 user->WriteNumeric(RPL_TOPIC, "%s :%s", this->name.c_str(), this->topic.c_str());
347 user->WriteNumeric(RPL_TOPICTIME, "%s %s %lu", this->name.c_str(), this->setby.c_str(), (unsigned long)this->topicset);
349 this->UserList(user);
352 FOREACH_MOD(OnPostJoin, (memb));
355 bool Channel::IsBanned(User* user)
358 FIRST_MOD_RESULT(OnCheckChannelBan, result, (user, this));
360 if (result != MOD_RES_PASSTHRU)
361 return (result == MOD_RES_DENY);
363 ListModeBase* banlm = static_cast<ListModeBase*>(*ban);
364 const ListModeBase::ModeList* bans = banlm->GetList(this);
367 for (ListModeBase::ModeList::const_iterator it = bans->begin(); it != bans->end(); it++)
369 if (CheckBan(user, it->mask))
376 bool Channel::CheckBan(User* user, const std::string& mask)
379 FIRST_MOD_RESULT(OnCheckBan, result, (user, this, mask));
380 if (result != MOD_RES_PASSTHRU)
381 return (result == MOD_RES_DENY);
383 // extbans were handled above, if this is one it obviously didn't match
384 if ((mask.length() <= 2) || (mask[1] == ':'))
387 std::string::size_type at = mask.find('@');
388 if (at == std::string::npos)
391 const std::string nickIdent = user->nick + "!" + user->ident;
392 std::string prefix = mask.substr(0, at);
393 if (InspIRCd::Match(nickIdent, prefix, NULL))
395 std::string suffix = mask.substr(at + 1);
396 if (InspIRCd::Match(user->host, suffix, NULL) ||
397 InspIRCd::Match(user->dhost, suffix, NULL) ||
398 InspIRCd::MatchCIDR(user->GetIPString(), suffix, NULL))
404 ModResult Channel::GetExtBanStatus(User *user, char type)
407 FIRST_MOD_RESULT(OnExtBanCheck, rv, (user, this, type));
408 if (rv != MOD_RES_PASSTHRU)
411 ListModeBase* banlm = static_cast<ListModeBase*>(*ban);
412 const ListModeBase::ModeList* bans = banlm->GetList(this);
415 for (ListModeBase::ModeList::const_iterator it = bans->begin(); it != bans->end(); ++it)
417 if (CheckBan(user, it->mask))
421 return MOD_RES_PASSTHRU;
425 * Remove a channel from a users record, remove the reference to the Membership object
426 * from the channel and destroy it.
428 void Channel::PartUser(User *user, std::string &reason)
430 UserMembIter membiter = userlist.find(user);
432 if (membiter != userlist.end())
434 Membership* memb = membiter->second;
436 FOREACH_MOD(OnUserPart, (memb, reason, except_list));
438 WriteAllExcept(user, false, 0, except_list, "PART %s%s%s", this->name.c_str(), reason.empty() ? "" : " :", reason.c_str());
440 // Remove this channel from the user's chanlist
441 user->chans.erase(memb);
442 // Remove the Membership from this channel's userlist and destroy it
443 this->DelUser(membiter);
447 void Channel::KickUser(User* src, User* victim, const std::string& reason, Membership* srcmemb)
449 UserMembIter victimiter = userlist.find(victim);
450 Membership* memb = ((victimiter != userlist.end()) ? victimiter->second : NULL);
454 src->WriteNumeric(ERR_USERNOTINCHANNEL, "%s %s :They are not on that channel", victim->nick.c_str(), this->name.c_str());
458 // Do the following checks only if the KICK is done by a local user;
459 // each server enforces its own rules.
462 // Modules are allowed to explicitly allow or deny kicks done by local users
464 FIRST_MOD_RESULT(OnUserPreKick, res, (src,memb,reason));
465 if (res == MOD_RES_DENY)
468 if (res == MOD_RES_PASSTHRU)
471 srcmemb = GetUser(src);
472 unsigned int them = srcmemb ? srcmemb->getRank() : 0;
473 unsigned int req = HALFOP_VALUE;
474 for (std::string::size_type i = 0; i < memb->modes.length(); i++)
476 ModeHandler* mh = ServerInstance->Modes->FindMode(memb->modes[i], MODETYPE_CHANNEL);
477 if (mh && mh->GetLevelRequired() > req)
478 req = mh->GetLevelRequired();
483 src->WriteNumeric(ERR_CHANOPRIVSNEEDED, "%s :You must be a channel %soperator",
484 this->name.c_str(), req > HALFOP_VALUE ? "" : "half-");
491 FOREACH_MOD(OnUserKick, (src, memb, reason, except_list));
493 WriteAllExcept(src, false, 0, except_list, "KICK %s %s :%s", name.c_str(), victim->nick.c_str(), reason.c_str());
495 victim->chans.erase(memb);
496 this->DelUser(victimiter);
499 void Channel::WriteChannel(User* user, const char* text, ...)
501 std::string textbuffer;
502 VAFORMAT(textbuffer, text, text);
503 this->WriteChannel(user, textbuffer);
506 void Channel::WriteChannel(User* user, const std::string &text)
508 const std::string message = ":" + user->GetFullHost() + " " + text;
510 for (UserMembIter i = userlist.begin(); i != userlist.end(); i++)
512 if (IS_LOCAL(i->first))
513 i->first->Write(message);
517 void Channel::WriteChannelWithServ(const std::string& ServName, const char* text, ...)
519 std::string textbuffer;
520 VAFORMAT(textbuffer, text, text);
521 this->WriteChannelWithServ(ServName, textbuffer);
524 void Channel::WriteChannelWithServ(const std::string& ServName, const std::string &text)
526 const std::string message = ":" + (ServName.empty() ? ServerInstance->Config->ServerName : ServName) + " " + text;
528 for (UserMembIter i = userlist.begin(); i != userlist.end(); i++)
530 if (IS_LOCAL(i->first))
531 i->first->Write(message);
535 /* write formatted text from a source user to all users on a channel except
536 * for the sender (for privmsg etc) */
537 void Channel::WriteAllExceptSender(User* user, bool serversource, char status, const char* text, ...)
539 std::string textbuffer;
540 VAFORMAT(textbuffer, text, text);
541 this->WriteAllExceptSender(user, serversource, status, textbuffer);
544 void Channel::WriteAllExcept(User* user, bool serversource, char status, CUList &except_list, const char* text, ...)
546 std::string textbuffer;
547 VAFORMAT(textbuffer, text, text);
548 textbuffer = ":" + (serversource ? ServerInstance->Config->ServerName : user->GetFullHost()) + " " + textbuffer;
549 this->RawWriteAllExcept(user, serversource, status, except_list, textbuffer);
552 void Channel::WriteAllExcept(User* user, bool serversource, char status, CUList &except_list, const std::string &text)
554 const std::string message = ":" + (serversource ? ServerInstance->Config->ServerName : user->GetFullHost()) + " " + text;
555 this->RawWriteAllExcept(user, serversource, status, except_list, message);
558 void Channel::RawWriteAllExcept(User* user, bool serversource, char status, CUList &except_list, const std::string &out)
560 unsigned int minrank = 0;
563 PrefixMode* mh = ServerInstance->Modes->FindPrefix(status);
565 minrank = mh->GetPrefixRank();
567 for (UserMembIter i = userlist.begin(); i != userlist.end(); i++)
569 if (IS_LOCAL(i->first) && (except_list.find(i->first) == except_list.end()))
571 /* User doesn't have the status we're after */
572 if (minrank && i->second->getRank() < minrank)
575 i->first->Write(out);
580 void Channel::WriteAllExceptSender(User* user, bool serversource, char status, const std::string& text)
583 except_list.insert(user);
584 this->WriteAllExcept(user, serversource, status, except_list, std::string(text));
587 const char* Channel::ChanModes(bool showkey)
589 static std::string scratch;
594 /* This was still iterating up to 190, Channel::modes is only 64 elements -- Om */
595 for(int n = 0; n < 64; n++)
597 ModeHandler* mh = ServerInstance->Modes->FindMode(n + 65, MODETYPE_CHANNEL);
598 if (mh && IsModeSet(mh))
600 scratch.push_back(n + 65);
602 ParamModeBase* pm = mh->IsParameterMode();
606 if (n == 'k' - 65 && !showkey)
613 pm->GetParameter(this, sparam);
619 return scratch.c_str();
622 /* compile a userlist of a channel into a string, each nick seperated by
623 * spaces and op, voice etc status shown as @ and +, and send it to 'user'
625 void Channel::UserList(User* user, bool has_user)
627 bool has_privs = user->HasPrivPermission("channels/auspex");
629 list.push_back(this->IsModeSet(secretmode) ? '@' : this->IsModeSet(privatemode) ? '*' : '=');
631 list.append(this->name).append(" :");
632 std::string::size_type pos = list.size();
634 const size_t maxlen = ServerInstance->Config->Limits.MaxLine - 10 - ServerInstance->Config->ServerName.size();
635 std::string prefixlist;
637 for (UserMembIter i = userlist.begin(); i != userlist.end(); ++i)
639 if ((!has_user) && (i->first->IsModeSet(invisiblemode)) && (!has_privs))
642 * user is +i, and source not on the channel, does not show
648 Membership* memb = i->second;
651 char prefix = memb->GetPrefixChar();
653 prefixlist.push_back(prefix);
654 nick = i->first->nick;
657 FIRST_MOD_RESULT(OnNamesListItem, res, (user, memb, prefixlist, nick));
659 // See if a module wants us to exclude this user from NAMES
660 if (res == MOD_RES_DENY)
663 if (list.size() + prefixlist.length() + nick.length() + 1 > maxlen)
665 /* list overflowed into multiple numerics */
666 user->WriteNumeric(RPL_NAMREPLY, list);
668 // Erase all nicks, keep the constant part
672 list.append(prefixlist).append(nick).push_back(' ');
675 // Only send the user list numeric if there is at least one user in it
676 if (list.size() != pos)
677 user->WriteNumeric(RPL_NAMREPLY, list);
679 user->WriteNumeric(RPL_ENDOFNAMES, "%s :End of /NAMES list.", this->name.c_str());
682 /* returns the status character for a given user on a channel, e.g. @ for op,
683 * % for halfop etc. If the user has several modes set, the highest mode
684 * the user has must be returned.
686 char Membership::GetPrefixChar() const
689 unsigned int bestrank = 0;
691 for (std::string::const_iterator i = modes.begin(); i != modes.end(); ++i)
693 PrefixMode* mh = ServerInstance->Modes->FindPrefixMode(*i);
694 if (mh && mh->GetPrefixRank() > bestrank && mh->GetPrefix())
696 bestrank = mh->GetPrefixRank();
697 pf = mh->GetPrefix();
703 unsigned int Membership::getRank()
705 char mchar = modes.c_str()[0];
709 PrefixMode* mh = ServerInstance->Modes->FindPrefixMode(mchar);
711 rv = mh->GetPrefixRank();
716 const char* Membership::GetAllPrefixChars() const
718 static char prefix[64];
721 for (std::string::const_iterator i = modes.begin(); i != modes.end(); ++i)
723 PrefixMode* mh = ServerInstance->Modes->FindPrefixMode(*i);
724 if (mh && mh->GetPrefix())
725 prefix[ctr++] = mh->GetPrefix();
732 unsigned int Channel::GetPrefixValue(User* user)
734 UserMembIter m = userlist.find(user);
735 if (m == userlist.end())
737 return m->second->getRank();
740 bool Membership::SetPrefix(PrefixMode* delta_mh, bool adding)
742 char prefix = delta_mh->GetModeChar();
743 for (unsigned int i = 0; i < modes.length(); i++)
745 char mchar = modes[i];
746 PrefixMode* mh = ServerInstance->Modes->FindPrefixMode(mchar);
747 if (mh && mh->GetPrefixRank() <= delta_mh->GetPrefixRank())
749 modes = modes.substr(0,i) +
750 (adding ? std::string(1, prefix) : "") +
751 modes.substr(mchar == prefix ? i+1 : i);
752 return adding != (mchar == prefix);
756 modes.push_back(prefix);
760 void Invitation::Create(Channel* c, LocalUser* u, time_t timeout)
762 if ((timeout != 0) && (ServerInstance->Time() >= timeout))
763 // Expired, don't bother
766 ServerInstance->Logs->Log("INVITATION", LOG_DEBUG, "Invitation::Create chan=%s user=%s", c->name.c_str(), u->uuid.c_str());
768 Invitation* inv = Invitation::Find(c, u, false);
771 if ((inv->expiry == 0) || (inv->expiry > timeout))
773 inv->expiry = timeout;
774 ServerInstance->Logs->Log("INVITATION", LOG_DEBUG, "Invitation::Create changed expiry in existing invitation %p", (void*) inv);
778 inv = new Invitation(c, u, timeout);
779 c->invites.push_front(inv);
780 u->invites.push_front(inv);
781 ServerInstance->Logs->Log("INVITATION", LOG_DEBUG, "Invitation::Create created new invitation %p", (void*) inv);
785 Invitation* Invitation::Find(Channel* c, LocalUser* u, bool check_expired)
787 ServerInstance->Logs->Log("INVITATION", LOG_DEBUG, "Invitation::Find chan=%s user=%s check_expired=%d", c ? c->name.c_str() : "NULL", u ? u->uuid.c_str() : "NULL", check_expired);
789 Invitation* result = NULL;
790 for (InviteList::iterator i = u->invites.begin(); i != u->invites.end(); )
792 Invitation* inv = *i;
795 if ((check_expired) && (inv->expiry != 0) && (inv->expiry <= ServerInstance->Time()))
797 /* Expired invite, remove it. */
798 std::string expiration = InspIRCd::TimeString(inv->expiry);
799 ServerInstance->Logs->Log("INVITATION", LOG_DEBUG, "Invitation::Find ecountered expired entry: %p expired %s", (void*) inv, expiration.c_str());
804 /* Is it what we're searching for? */
813 ServerInstance->Logs->Log("INVITATION", LOG_DEBUG, "Invitation::Find result=%p", (void*) result);
817 Invitation::~Invitation()
819 // Remove this entry from both lists
820 chan->invites.erase(this);
821 user->invites.erase(this);
822 ServerInstance->Logs->Log("INVITEBASE", LOG_DEBUG, "Invitation::~ %p", (void*) this);