From c9447a9088997d2309fd2a46fb720115337c3706 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 13 Dec 2005 23:17:22 +0000 Subject: #define IS_LOCAL(x) (x->fd > -1) #define IS_REMOTE(x) (x->fd < 0) #define IS_MODULE_CREATED(x) (x->fd == FD_MAGIC_NUMBER) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2386 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/commands.cpp | 2 +- src/helperfuncs.cpp | 4 ++-- src/inspircd.cpp | 5 +++-- src/modules/m_spanningtree.cpp | 2 +- src/xline.cpp | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/commands.cpp b/src/commands.cpp index 1c4f10470..2c351868c 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -639,7 +639,7 @@ void handle_privmsg(char **parameters, int pcnt, userrec *user) } parameters[1] = (char*)temp.c_str(); - if (dest->server > -1) + if (dest->fd > -1) { // direct write, same server WriteTo(user, dest, "PRIVMSG %s :%s", dest->nick, parameters[1]); diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index c4c6f397b..42dec9b7c 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -1117,7 +1117,7 @@ int usercount_unknown(void) for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) { - if ((i->second->fd) && (i->second->registered != 7)) + if ((i->second->fd > -1) && (i->second->registered != 7)) c++; } return c; @@ -1133,7 +1133,7 @@ long local_count() int c = 0; for (user_hash::const_iterator i = clientlist.begin(); i != clientlist.end(); i++) { - if ((i->second->fd) && (isnick(i->second->nick)) && (i->second->server->fd > -1)) c++; + if ((isnick(i->second->nick)) && (i->second->fd > -1)) c++; } return c; } diff --git a/src/inspircd.cpp b/src/inspircd.cpp index f38daef65..506860999 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -587,8 +587,9 @@ chanrec* add_channel(userrec *user, const char* cn, const char* key, bool overri { MOD_RESULT = 0; FOREACH_RESULT(OnUserPreJoin(user,Ptr,cname)); - if (MOD_RESULT == 1) { - return NULL + if (MOD_RESULT == 1) + { + return NULL; } else { diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index daa7111ee..4c4562728 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -2724,7 +2724,7 @@ class ModuleSpanningTree : public Module virtual void OnUserKick(userrec* source, userrec* user, chanrec* chan, std::string reason) { - if (source->server > -1) + if (source->fd > -1) { std::deque params; params.push_back(chan->name); diff --git a/src/xline.cpp b/src/xline.cpp index 434aaeeb1..c06d977fa 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -702,7 +702,7 @@ void apply_lines() go_again = false; for (user_hash::const_iterator u = clientlist.begin(); u != clientlist.end(); u++) { - if (u->second->server > -1) + if (u->second->fd > -1) { snprintf(host,MAXBUF,"%s@%s",u->second->ident,u->second->host); if (elines.size()) -- cgit v1.2.3