From aaf5226111f515f4baa68e95ea6a1db740828ac3 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 8 Mar 2006 23:16:18 +0000 Subject: Removed has_channel(userrec*,chanrec*), the new preferred way of doing it is channel->HasUser(userrec) Yeah its the other way around to the old way, but somehow, seems less backwards to me (its also faster) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3560 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_operwho.cpp | 2 +- src/modules/m_safelist.cpp | 5 +++-- src/modules/m_uninvite.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_operwho.cpp b/src/modules/m_operwho.cpp index e4dbf3235..8926b2a9c 100644 --- a/src/modules/m_operwho.cpp +++ b/src/modules/m_operwho.cpp @@ -128,7 +128,7 @@ class ModuleOperWho : public Module { for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) { - if ((has_channel(i->second,Ptr)) && (isnick(i->second->nick))) + if ((Ptr->HasUser(i->second)) && (isnick(i->second->nick))) { // Fix Bug #29 - Part 2.. *tmp = 0; diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp index debacaaeb..6e1789097 100644 --- a/src/modules/m_safelist.cpp +++ b/src/modules/m_safelist.cpp @@ -97,10 +97,11 @@ class ListTimer : public InspTimer WriteServ(u->fd,"321 %s Channel :Users Name",u->nick); chan = Srv->GetChannelIndex(ld->list_position); /* spool details */ - if ((chan) && (((!(chan->binarymodes & CM_PRIVATE)) && (!(chan->binarymodes & CM_SECRET))) || (has_channel(u,chan)))) + bool has_user = chan->HasUser(u); + if ((chan) && (((!(chan->binarymodes & CM_PRIVATE)) && (!(chan->binarymodes & CM_SECRET))) || (has_user))) { /* Increment total plus linefeed */ - int counter = snprintf(buffer,MAXBUF,"322 %s %s %d :[+%s] %s",u->nick,chan->name,usercount_i(chan),chanmodes(chan,has_channel(u,chan)),chan->topic); + int counter = snprintf(buffer,MAXBUF,"322 %s %s %d :[+%s] %s",u->nick,chan->name,usercount_i(chan),chanmodes(chan,has_user),chan->topic); amount_sent += counter + 4 + Srv->GetServerName().length(); log(DEBUG,"m_safelist.so: Sent %ld of safe %ld / 4",amount_sent,u->sendqmax); WriteServ_NoFormat(u->fd,buffer); diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp index e9c2078cb..dbd3af52f 100644 --- a/src/modules/m_uninvite.cpp +++ b/src/modules/m_uninvite.cpp @@ -70,7 +70,7 @@ class cmd_uninvite : public command_t WriteServ(user->fd,"491 %s %s %s :Is not invited to channel %s",user->nick,u->nick,c->name,c->name); return; } - if (!has_channel(user,c)) + if (!c->HasUser(user)) { WriteServ(user->fd,"492 %s %s :You're not on that channel!",user->nick, c->name); return; -- cgit v1.2.3