summaryrefslogtreecommitdiff
path: root/src/message.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-08 23:16:18 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-03-08 23:16:18 +0000
commitaaf5226111f515f4baa68e95ea6a1db740828ac3 (patch)
treeab8b622f04ebf09448ee0f2e02f32496812db003 /src/message.cpp
parentec97c162f84a3979a0f6a1c3443366784062ac9e (diff)
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
Diffstat (limited to 'src/message.cpp')
-rw-r--r--src/message.cpp25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/message.cpp b/src/message.cpp
index 9cfecb850..e943aa784 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -371,29 +371,6 @@ int cstatus(userrec *user, chanrec *chan)
return STATUS_NORMAL;
}
-/* returns 1 if user u has channel c in their record, 0 if not */
-
-int has_channel(userrec *u, chanrec *c)
-{
- if ((!u) || (!c))
- {
- log(DEFAULT,"*** BUG *** has_channel was given an invalid parameter");
- return 0;
- }
- for (unsigned int i =0; i < u->chans.size(); i++)
- {
- if (u->chans[i].channel)
- {
- if (u->chans[i].channel == c)
- {
- return 1;
- }
- }
- }
- return 0;
-}
-
-
void TidyBan(char *ban)
{
if (!ban) {
@@ -443,7 +420,7 @@ std::string chlist(userrec *user,userrec* source)
{
// if the channel is NOT private/secret, OR the source user is on the channel, AND the user is not invisible.
// if the user is the same as the source, shortcircuit the comparison.
- if ((source == user) || ((((!(user->chans[i].channel->binarymodes & CM_PRIVATE)) && (!(user->chans[i].channel->binarymodes & CM_SECRET)) && (!userinvisible)) || (has_channel(source,user->chans[i].channel)))))
+ if ((source == user) || ((((!(user->chans[i].channel->binarymodes & CM_PRIVATE)) && (!(user->chans[i].channel->binarymodes & CM_SECRET)) && (!userinvisible)) || (user->chans[i].channel->HasUser(source)))))
{
lst = lst + std::string(cmode(user,user->chans[i].channel)) + std::string(user->chans[i].channel->name) + " ";
}