diff --git a/include/channels.h b/include/channels.h index 2d070fdae..a65a388b9 100644 --- a/include/channels.h +++ b/include/channels.h @@ -23,8 +23,8 @@ typedef Anope::unordered_map channel_map; extern CoreExport channel_map ChannelList; -/* A user container, there is one of these per user per channel. */ -struct ChanUserContainer final +/* A user's membership to a channel, there is one of these per user per channel. */ +struct Membership final : public Extensible { User *user; @@ -32,7 +32,11 @@ struct ChanUserContainer final /* Status the user has in the channel */ ChannelStatus status; - ChanUserContainer(User *u, Channel *c) : user(u), chan(c) { } + Membership(User *u, Channel *c) + : user(u) + , chan(c) + { + } }; class CoreExport Channel final @@ -61,7 +65,7 @@ public: bool botchannel = false; /* Users in the channel */ - typedef std::map ChanUserList; + typedef std::map ChanUserList; ChanUserList users; /* Current topic of the channel */ @@ -114,9 +118,9 @@ public: /** Join a user internally to the channel * @param u The user * @param status The status to give the user, if any - * @return The UserContainer for the user + * @return The membership for the user */ - ChanUserContainer *JoinUser(User *u, const ChannelStatus *status); + Membership *JoinUser(User *u, const ChannelStatus *status); /** Remove a user internally from the channel * @param u The user @@ -125,9 +129,9 @@ public: /** Check if the user is on the channel * @param u The user - * @return A user container if found, else NULL + * @return A membership if found, else NULL */ - ChanUserContainer *FindUser(User *u) const; + Membership *FindUser(User *u) const; /** Check if a user has a status on a channel * @param u The user diff --git a/include/defs.h b/include/defs.h index 613ee703c..62e164436 100644 --- a/include/defs.h +++ b/include/defs.h @@ -22,7 +22,6 @@ class Channel; class ChannelInfo; class ChannelStatus; namespace ChanServ { class AutoKick; class ModeLock; } -struct ChanUserContainer; class ClientSocket; class Command; class CommandSource; @@ -35,6 +34,7 @@ class InfoFormatter; class IRCDProto; class ListenSocket; class Log; +struct Membership; class Memo; struct MemoInfo; class MessageSource; diff --git a/include/modules.h b/include/modules.h index d3661a6cd..c39e2fe62 100644 --- a/include/modules.h +++ b/include/modules.h @@ -292,10 +292,10 @@ public: /** Called before a user has been kicked from a channel. * @param source The kicker - * @param cu The user, channel, and status of the user being kicked + * @param memb The membership for the user who is being kicked * @param kickmsg The reason for the kick. */ - virtual void OnPreUserKicked(const MessageSource &source, ChanUserContainer *cu, const Anope::string &kickmsg) ATTR_NOT_NULL(3) { throw NotImplementedException(); } + virtual void OnPreUserKicked(const MessageSource &source, Membership *memb, const Anope::string &kickmsg) ATTR_NOT_NULL(3) { throw NotImplementedException(); } /** Called when a user has been kicked from a channel. * @param source The kicker diff --git a/include/users.h b/include/users.h index 28b7d7c59..1941ba1ef 100644 --- a/include/users.h +++ b/include/users.h @@ -89,7 +89,7 @@ public: // XXX: exposing a tiny bit too much time_t awaytime = 0; /* Channels the user is in */ - typedef std::map ChanUserList; + typedef std::map ChanUserList; ChanUserList chans; /* Last time this user sent a memo command used */ @@ -338,9 +338,9 @@ public: * This is preferred over using FindUser in Channel, as there are usually more users in a channel * than channels a user is in * @param c The channel - * @return The channel container, or NULL + * @return The channel membership, or NULL */ - ChanUserContainer *FindChannel(Channel *c) const; + Membership *FindChannel(Channel *c) const; /** Check if the user is protected from kicks and negative mode changes * @return true or false diff --git a/modules/botserv/bs_kick.cpp b/modules/botserv/bs_kick.cpp index a50d262f8..8f782d0e3 100644 --- a/modules/botserv/bs_kick.cpp +++ b/modules/botserv/bs_kick.cpp @@ -1081,11 +1081,11 @@ class BSKick final UserData *GetUserData(User *u, Channel *c) { - ChanUserContainer *uc = c->FindUser(u); - if (uc == NULL) + auto *memb = c->FindUser(u); + if (memb == NULL) return NULL; - UserData *ud = userdata.Require(uc); + UserData *ud = userdata.Require(memb); return ud; } diff --git a/modules/chanserv/chanserv.cpp b/modules/chanserv/chanserv.cpp index 792521992..18f743544 100644 --- a/modules/chanserv/chanserv.cpp +++ b/modules/chanserv/chanserv.cpp @@ -462,9 +462,9 @@ public: { if (!always_lower && Anope::CurTime == c->created && c->ci && setter.GetUser() && !setter.GetUser()->server->IsULined()) { - ChanUserContainer *cu = c->FindUser(setter.GetUser()); + auto *memb = c->FindUser(setter.GetUser()); ChannelMode *cm = ModeManager::FindChannelModeByName("OP"); - if (cu && cm && !cu->status.HasMode(cm->mchar)) + if (memb && cm && !memb->status.HasMode(cm->mchar)) { /* Our -o and their mode change crossing, bounce their mode */ c->RemoveMode(c->ci->WhoSends(), mode, data.value); diff --git a/modules/chanserv/cs_akick.cpp b/modules/chanserv/cs_akick.cpp index c9743e0b1..49c8cac4a 100644 --- a/modules/chanserv/cs_akick.cpp +++ b/modules/chanserv/cs_akick.cpp @@ -203,10 +203,10 @@ class CommandCSAKick final for (Channel::ChanUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end; ) { - ChanUserContainer *uc = it->second; + auto *memb = it->second; ++it; - if (c->CheckKick(uc->user)) + if (c->CheckKick(memb->user)) ++count; } diff --git a/modules/chanserv/cs_ban.cpp b/modules/chanserv/cs_ban.cpp index e0314cb6a..f02ae302a 100644 --- a/modules/chanserv/cs_ban.cpp +++ b/modules/chanserv/cs_ban.cpp @@ -213,23 +213,23 @@ public: int matched = 0, kicked = 0; for (Channel::ChanUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end;) { - ChanUserContainer *uc = it->second; + auto *memb = it->second; ++it; Entry e(mode, mask); - if (e.Matches(uc->user)) + if (e.Matches(memb->user)) { ++matched; - AccessGroup u2_access = ci->AccessFor(uc->user); + AccessGroup u2_access = ci->AccessFor(memb->user); if (matched > 1 && !founder) continue; - if (u != uc->user && ci->HasExt("PEACE") && u2_access >= u_access) + if (u != memb->user && ci->HasExt("PEACE") && u2_access >= u_access) continue; - else if (ci->c->MatchesList(uc->user, "EXCEPT")) + else if (ci->c->MatchesList(memb->user, "EXCEPT")) continue; - else if (uc->user->IsProtected()) + else if (memb->user->IsProtected()) continue; if (block.Get("kick", "yes")) @@ -242,10 +242,10 @@ public: { "message", reason }, { "nick", source.GetNick() }, }); - c->Kick(ci->WhoSends(), uc->user, signkickformat); + c->Kick(ci->WhoSends(), memb->user, signkickformat); } else - c->Kick(ci->WhoSends(), uc->user, "%s (Matches %s)", reason.c_str(), mask.c_str()); + c->Kick(ci->WhoSends(), memb->user, "%s (Matches %s)", reason.c_str(), mask.c_str()); } } } diff --git a/modules/chanserv/cs_enforce.cpp b/modules/chanserv/cs_enforce.cpp index cdc61b1f1..baff006c5 100644 --- a/modules/chanserv/cs_enforce.cpp +++ b/modules/chanserv/cs_enforce.cpp @@ -179,8 +179,8 @@ private: /* The newer users are at the end of the list, so kick users starting from the end */ for (Channel::ChanUserList::reverse_iterator it = ci->c->users.rbegin(), it_end = ci->c->users.rend(); it != it_end; ++it) { - ChanUserContainer *uc = it->second; - User *user = uc->user; + auto *memb = it->second; + User *user = memb->user; if (user->IsProtected()) continue; diff --git a/modules/chanserv/cs_kick.cpp b/modules/chanserv/cs_kick.cpp index fd98cddf7..2e87cf852 100644 --- a/modules/chanserv/cs_kick.cpp +++ b/modules/chanserv/cs_kick.cpp @@ -92,18 +92,18 @@ public: int matched = 0, kicked = 0; for (Channel::ChanUserList::iterator it = c->users.begin(), it_end = c->users.end(); it != it_end;) { - ChanUserContainer *uc = it->second; + auto *memb = it->second; ++it; Entry e("", mask); - if (e.Matches(uc->user)) + if (e.Matches(memb->user)) { ++matched; - AccessGroup u2_access = ci->AccessFor(uc->user); - if (u != uc->user && ci->HasExt("PEACE") && u2_access >= u_access) + AccessGroup u2_access = ci->AccessFor(memb->user); + if (u != memb->user && ci->HasExt("PEACE") && u2_access >= u_access) continue; - else if (uc->user->IsProtected()) + else if (memb->user->IsProtected()) continue; ++kicked; @@ -114,10 +114,10 @@ public: { "message", reason }, { "nick", source.GetNick() }, }); - c->Kick(ci->WhoSends(), uc->user, signkickformat); + c->Kick(ci->WhoSends(), memb->user, signkickformat); } else - c->Kick(ci->WhoSends(), uc->user, "%s (Matches %s)", reason.c_str(), mask.c_str()); + c->Kick(ci->WhoSends(), memb->user, "%s (Matches %s)", reason.c_str(), mask.c_str()); } } diff --git a/modules/chanserv/cs_mode.cpp b/modules/chanserv/cs_mode.cpp index 222ebf676..ab84de344 100644 --- a/modules/chanserv/cs_mode.cpp +++ b/modules/chanserv/cs_mode.cpp @@ -603,14 +603,14 @@ class CommandCSMode final for (Channel::ChanUserList::const_iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end;) { - ChanUserContainer *uc = it->second; + auto *memb = it->second; ++it; - AccessGroup targ_access = ci->AccessFor(uc->user); + AccessGroup targ_access = ci->AccessFor(memb->user); - if (uc->user->IsProtected()) + if (memb->user->IsProtected()) { - source.Reply(_("You do not have the access to change %s's modes."), uc->user->nick.c_str()); + source.Reply(_("You do not have the access to change %s's modes."), memb->user->nick.c_str()); continue; } @@ -622,17 +622,17 @@ class CommandCSMode final } else { - source.Reply(_("You do not have the access to change %s's modes."), uc->user->nick.c_str()); + source.Reply(_("You do not have the access to change %s's modes."), memb->user->nick.c_str()); continue; } } - if (Anope::Match(uc->user->GetMask(), param)) + if (Anope::Match(memb->user->GetMask(), param)) { if (adding) - ci->c->SetMode(NULL, cm, uc->user->GetUID()); + ci->c->SetMode(NULL, cm, memb->user->GetUID()); else - ci->c->RemoveMode(NULL, cm, uc->user->GetUID()); + ci->c->RemoveMode(NULL, cm, memb->user->GetUID()); } } } diff --git a/modules/chanserv/cs_seen.cpp b/modules/chanserv/cs_seen.cpp index 8bcd85b26..c555fa35d 100644 --- a/modules/chanserv/cs_seen.cpp +++ b/modules/chanserv/cs_seen.cpp @@ -420,9 +420,9 @@ public: UpdateUser(u, PART, u->nick, "", channel, msg); } - void OnPreUserKicked(const MessageSource &source, ChanUserContainer *cu, const Anope::string &msg) override + void OnPreUserKicked(const MessageSource &source, Membership *memb, const Anope::string &msg) override { - UpdateUser(cu->user, KICK, cu->user->nick, source.GetSource(), cu->chan->name, msg); + UpdateUser(memb->user, KICK, memb->user->nick, source.GetSource(), memb->chan->name, msg); } private: diff --git a/modules/chanserv/cs_updown.cpp b/modules/chanserv/cs_updown.cpp index 9e3dbaf2e..023ad988d 100644 --- a/modules/chanserv/cs_updown.cpp +++ b/modules/chanserv/cs_updown.cpp @@ -140,10 +140,12 @@ class CommandCSDown final { static void RemoveAll(User *u, Channel *c) { - ChanUserContainer *cu = c->FindUser(u); - if (cu != NULL) - for (size_t i = cu->status.Modes().length(); i > 0;) - c->RemoveMode(NULL, ModeManager::FindChannelModeByChar(cu->status.Modes()[--i]), u->GetUID()); + auto *memb = c->FindUser(u); + if (memb != NULL) + { + for (size_t i = memb->status.Modes().length(); i > 0;) + c->RemoveMode(NULL, ModeManager::FindChannelModeByChar(memb->status.Modes()[--i]), u->GetUID()); + } } public: diff --git a/modules/chanstats.cpp b/modules/chanstats.cpp index 9a356085b..563fea722 100644 --- a/modules/chanstats.cpp +++ b/modules/chanstats.cpp @@ -571,18 +571,18 @@ private: } public: - void OnPreUserKicked(const MessageSource &source, ChanUserContainer *cu, const Anope::string &kickmsg) override + void OnPreUserKicked(const MessageSource &source, Membership *memb, const Anope::string &kickmsg) override { - if (!cu->chan->ci || !cs_stats.HasExt(cu->chan->ci)) + if (!memb->chan->ci || !cs_stats.HasExt(memb->chan->ci)) return; query = "CALL " + prefix + "chanstats_proc_update(@channel@, @nick@, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0);"; - query.SetValue("channel", cu->chan->name); - query.SetValue("nick", GetDisplay(cu->user)); + query.SetValue("channel", memb->chan->name); + query.SetValue("nick", GetDisplay(memb->user)); this->RunQuery(query); query = "CALL " + prefix + "chanstats_proc_update(@channel@, @nick@, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0);"; - query.SetValue("channel", cu->chan->name); + query.SetValue("channel", memb->chan->name); query.SetValue("nick", GetDisplay(source.GetUser())); this->RunQuery(query); } diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp index 52cdbb68b..9fb47f785 100644 --- a/modules/protocol/hybrid.cpp +++ b/modules/protocol/hybrid.cpp @@ -117,16 +117,16 @@ public: * If the user is internally on the channel with flags, kill them so that * the stacker will allow this. */ - ChanUserContainer *uc = c->FindUser(u); - if (uc) - uc->status.Clear(); + auto *memb = c->FindUser(u); + if (memb) + memb->status.Clear(); BotInfo *setter = BotInfo::Find(u->GetUID()); for (auto mode : cs.Modes()) c->SetMode(setter, ModeManager::FindChannelModeByChar(mode), u->GetUID(), false); - if (uc) - uc->status = cs; + if (memb) + memb->status = cs; } } diff --git a/modules/protocol/inspircd.cpp b/modules/protocol/inspircd.cpp index d3f20d58f..cbc822942 100644 --- a/modules/protocol/inspircd.cpp +++ b/modules/protocol/inspircd.cpp @@ -511,16 +511,16 @@ public: /* If the user is internally on the channel with flags, kill them so that * the stacker will allow this. */ - ChanUserContainer *uc = c->FindUser(user); - if (uc != NULL) - uc->status.Clear(); + auto *memb = c->FindUser(user); + if (memb != NULL) + memb->status.Clear(); BotInfo *setter = BotInfo::Find(user->GetUID()); for (auto mode : cs.Modes()) c->SetMode(setter, ModeManager::FindChannelModeByChar(mode), user->GetUID(), false); - if (uc != NULL) - uc->status = cs; + if (memb != NULL) + memb->status = cs; } } @@ -817,9 +817,9 @@ namespace InspIRCdExtBan Channel *c = Channel::Find(channel); if (c != NULL) { - ChanUserContainer *uc = c->FindUser(u); - if (uc != NULL) - if (cm == NULL || uc->status.HasMode(cm->mchar)) + auto *memb = c->FindUser(u); + if (memb != NULL) + if (cm == NULL || memb->status.HasMode(cm->mchar)) return true; } diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp index 84a317dc3..d36614cb6 100644 --- a/modules/protocol/ngircd.cpp +++ b/modules/protocol/ngircd.cpp @@ -100,16 +100,16 @@ public: /* If the user is internally on the channel with flags, kill them so that * the stacker will allow this. */ - ChanUserContainer *uc = c->FindUser(user); - if (uc != NULL) - uc->status.Clear(); + auto *memb = c->FindUser(user); + if (memb != NULL) + memb->status.Clear(); BotInfo *setter = BotInfo::Find(user->GetUID()); for (auto mode : cs.Modes()) c->SetMode(setter, ModeManager::FindChannelModeByChar(mode), user->GetUID(), false); - if (uc != NULL) - uc->status = cs; + if (memb != NULL) + memb->status = cs; } } diff --git a/modules/protocol/plexus.cpp b/modules/protocol/plexus.cpp index 0f5a86cbb..8aa3479eb 100644 --- a/modules/protocol/plexus.cpp +++ b/modules/protocol/plexus.cpp @@ -72,16 +72,16 @@ public: /* If the user is internally on the channel with flags, kill them so that * the stacker will allow this. */ - ChanUserContainer *uc = c->FindUser(user); - if (uc != NULL) - uc->status.Clear(); + auto *memb = c->FindUser(user); + if (memb != NULL) + memb->status.Clear(); BotInfo *setter = BotInfo::Find(user->GetUID()); for (auto mode : cs.Modes()) c->SetMode(setter, ModeManager::FindChannelModeByChar(mode), user->GetUID(), false); - if (uc != NULL) - uc->status = cs; + if (memb != NULL) + memb->status = cs; } } diff --git a/modules/protocol/unrealircd.cpp b/modules/protocol/unrealircd.cpp index 379dfd088..d32b6686b 100644 --- a/modules/protocol/unrealircd.cpp +++ b/modules/protocol/unrealircd.cpp @@ -194,16 +194,16 @@ private: /* If the user is internally on the channel with flags, kill them so that * the stacker will allow this. */ - ChanUserContainer *uc = c->FindUser(user); - if (uc != NULL) - uc->status.Clear(); + auto *memb = c->FindUser(user); + if (memb != NULL) + memb->status.Clear(); BotInfo *setter = BotInfo::Find(user->GetUID()); for (auto mode : cs.Modes()) c->SetMode(setter, ModeManager::FindChannelModeByChar(mode), user->GetUID(), false); - if (uc != NULL) - uc->status = cs; + if (memb != NULL) + memb->status = cs; } } @@ -543,9 +543,9 @@ namespace UnrealExtBan Channel *c = Channel::Find(channel); if (c != NULL) { - ChanUserContainer *uc = c->FindUser(u); - if (uc != NULL) - if (cm == NULL || uc->status.HasMode(cm->mchar)) + auto *memb = c->FindUser(u); + if (memb != NULL) + if (cm == NULL || memb->status.HasMode(cm->mchar)) return true; } diff --git a/src/channels.cpp b/src/channels.cpp index 762f7d9ca..6288958aa 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -135,18 +135,18 @@ bool Channel::CheckDelete() return MOD_RESULT != EVENT_STOP && this->users.empty(); } -ChanUserContainer *Channel::JoinUser(User *user, const ChannelStatus *status) +Membership *Channel::JoinUser(User *user, const ChannelStatus *status) { if (user->server && user->server->IsSynced()) Log(user, this, "join"); - auto *cuc = new ChanUserContainer(user, this); - user->chans[this] = cuc; - this->users[user] = cuc; + auto *memb = new Membership(user, this); + user->chans[this] = memb; + this->users[user] = memb; if (status) - cuc->status = *status; + memb->status = *status; - return cuc; + return memb; } void Channel::DeleteUser(User *user) @@ -156,18 +156,18 @@ void Channel::DeleteUser(User *user) FOREACH_MOD(OnLeaveChannel, (user, this)); - ChanUserContainer *cu = user->FindChannel(this); + auto *memb = user->FindChannel(this); if (!this->users.erase(user)) Log(LOG_DEBUG) << "Channel::DeleteUser() tried to delete nonexistent user " << user->nick << " from channel " << this->name; if (!user->chans.erase(this)) Log(LOG_DEBUG) << "Channel::DeleteUser() tried to delete nonexistent channel " << this->name << " from " << user->nick << "'s channel list"; - delete cu; + delete memb; QueueForDeletion(); } -ChanUserContainer *Channel::FindUser(User *u) const +Membership *Channel::FindUser(User *u) const { ChanUserList::const_iterator it = this->users.find(u); if (it != this->users.end()) @@ -178,13 +178,13 @@ ChanUserContainer *Channel::FindUser(User *u) const bool Channel::HasUserStatus(User *u, ChannelModeStatus *cms) { /* Usually its more efficient to search the users channels than the channels users */ - ChanUserContainer *cc = u->FindChannel(this); - if (cc) + auto *memb = u->FindChannel(this); + if (memb) { if (cms) - return cc->status.HasMode(cms->mchar); + return memb->status.HasMode(cms->mchar); else - return cc->status.Empty(); + return memb->status.Empty(); } return false; @@ -281,9 +281,9 @@ void Channel::SetModeInternal(MessageSource &setter, ChannelMode *ocm, const Mod Log(LOG_DEBUG) << "Setting +" << cm->mchar << " on " << this->name << " for " << u->nick; /* Set the status on the user */ - ChanUserContainer *cc = u->FindChannel(this); - if (cc) - cc->status.AddMode(cm->mchar); + auto *memb = u->FindChannel(this); + if (memb) + memb->status.AddMode(cm->mchar); FOREACH_RESULT(OnChannelModeSet, MOD_RESULT, (this, setter, cm, data)); @@ -352,9 +352,9 @@ void Channel::RemoveModeInternal(MessageSource &setter, ChannelMode *ocm, const Log(LOG_DEBUG) << "Setting -" << cm->mchar << " on " << this->name << " for " << u->nick; /* Remove the status on the user */ - ChanUserContainer *cc = u->FindChannel(this); - if (cc) - cc->status.DelMode(cm->mchar); + auto *memb = u->FindChannel(this); + if (memb) + memb->status.DelMode(cm->mchar); FOREACH_RESULT(OnChannelModeUnset, MOD_RESULT, (this, setter, cm, param)); @@ -762,16 +762,16 @@ void Channel::KickInternal(const MessageSource &source, const Anope::string &nic Anope::string chname = this->name; - ChanUserContainer *cu = target->FindChannel(this); - if (cu == NULL) + auto *memb = target->FindChannel(this); + if (memb == NULL) { Log(LOG_DEBUG) << "Channel::KickInternal got kick for user " << target->nick << " from " << source.GetSource() << " who isn't on channel " << this->name; return; } - ChannelStatus status = cu->status; + ChannelStatus status = memb->status; - FOREACH_MOD(OnPreUserKicked, (source, cu, reason)); + FOREACH_MOD(OnPreUserKicked, (source, memb, reason)); this->DeleteUser(target); FOREACH_MOD(OnUserKicked, (source, target, this->name, status, reason)); } diff --git a/src/config.cpp b/src/config.cpp index 0e17e044e..b7ca41060 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -382,10 +382,10 @@ Conf::Conf() : Block("") c->botchannel = true; /* Remove all existing modes */ - ChanUserContainer *cu = c->FindUser(bi); - if (cu != NULL) + auto *memb = c->FindUser(bi); + if (memb != NULL) { - for (auto mode : cu->status.Modes()) + for (auto mode : memb->status.Modes()) c->RemoveMode(bi, ModeManager::FindChannelModeByChar(mode), bi->GetUID()); } /* Set the new modes */ diff --git a/src/messages.cpp b/src/messages.cpp index 91ac3b755..c300e935a 100644 --- a/src/messages.cpp +++ b/src/messages.cpp @@ -92,12 +92,12 @@ void Join::Run(MessageSource &source, const std::vector ¶ms, { for (User::ChanUserList::iterator it = user->chans.begin(), it_end = user->chans.end(); it != it_end; ) { - ChanUserContainer *cc = it->second; - Channel *c = cc->chan; + auto *memb = it->second; + Channel *c = memb->chan; ++it; FOREACH_MOD(OnPrePartChannel, (user, c)); - cc->chan->DeleteUser(user); + memb->chan->DeleteUser(user); FOREACH_MOD(OnPartChannel, (user, c, c->name, "")); } continue; diff --git a/src/users.cpp b/src/users.cpp index 37cd6e4c1..cfe9d5f1d 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -738,7 +738,7 @@ const User::ModeList &User::GetModeList() const return modes; } -ChanUserContainer *User::FindChannel(Channel *c) const +Membership *User::FindChannel(Channel *c) const { User::ChanUserList::const_iterator it = this->chans.find(c); if (it != this->chans.end())