]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/channels.cpp
Remove classbase inheritance from Invitation
[user/henk/code/inspircd.git] / src / channels.cpp
index 4e266fb7c4ba860ad3c1ceb26eac32c4c336493d..51a8f5625c920928c862c3b845718449438a1e83 100644 (file)
@@ -331,7 +331,7 @@ void Channel::ForceJoin(User* user, const std::string* privs, bool bursting, boo
        if (!memb)
                return; // Already on the channel
 
-       user->chans.insert(this);
+       user->chans.push_front(memb);
 
        if (privs)
        {
@@ -466,7 +466,7 @@ void Channel::PartUser(User *user, std::string &reason)
                WriteAllExcept(user, false, 0, except_list, "PART %s%s%s", this->name.c_str(), reason.empty() ? "" : " :", reason.c_str());
 
                // Remove this channel from the user's chanlist
-               user->chans.erase(this);
+               user->chans.erase(memb);
                // Remove the Membership from this channel's userlist and destroy it
                this->DelUser(membiter);
        }
@@ -520,7 +520,7 @@ void Channel::KickUser(User* src, User* victim, const std::string& reason, Membe
 
        WriteAllExcept(src, false, 0, except_list, "KICK %s %s :%s", name.c_str(), victim->nick.c_str(), reason.c_str());
 
-       victim->chans.erase(this);
+       victim->chans.erase(memb);
        this->DelUser(victimiter);
 }
 
@@ -654,7 +654,8 @@ const char* Channel::ChanModes(bool showkey)
  */
 void Channel::UserList(User *user)
 {
-       if (this->IsModeSet(secretmode) && !this->HasUser(user) && !user->HasPrivPermission("channels/auspex"))
+       bool has_privs = user->HasPrivPermission("channels/auspex");
+       if (this->IsModeSet(secretmode) && !this->HasUser(user) && !has_privs)
        {
                user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", this->name.c_str());
                return;
@@ -679,7 +680,7 @@ void Channel::UserList(User *user)
        {
                if (i->first->quitting)
                        continue;
-               if ((!has_user) && (i->first->IsModeSet(invisiblemode)))
+               if ((!has_user) && (i->first->IsModeSet(invisiblemode)) && (!has_privs))
                {
                        /*
                         * user is +i, and source not on the channel, does not show
@@ -849,10 +850,9 @@ Invitation* Invitation::Find(Channel* c, LocalUser* u, bool check_expired)
                if ((check_expired) && (inv->expiry != 0) && (inv->expiry <= ServerInstance->Time()))
                {
                        /* Expired invite, remove it. */
-                       std::string expiration = ServerInstance->TimeString(inv->expiry);
+                       std::string expiration = InspIRCd::TimeString(inv->expiry);
                        ServerInstance->Logs->Log("INVITATION", LOG_DEBUG, "Invitation::Find ecountered expired entry: %p expired %s", (void*) inv, expiration.c_str());
                        i = locallist.erase(i);
-                       inv->cull();
                        delete inv;
                }
                else
@@ -890,7 +890,6 @@ void InviteBase::ClearInvites()
        locallist.swap(invites);
        for (InviteList::const_iterator i = locallist.begin(); i != locallist.end(); ++i)
        {
-               (*i)->cull();
                delete *i;
        }
 }