From 9d2ef3f13085cf46913eb743e2561ea217c866fa Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 29 Sep 2010 14:02:17 -0400 Subject: [PATCH] Allow OnPreConnect to kill users correctly and made session/xline exempt users not bypass the OnConnect event --- src/users.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/users.cpp b/src/users.cpp index 8ebe339ea..d4b1e15f2 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -762,18 +762,18 @@ User *do_nick(const Anope::string &source, const Anope::string &nick, const Anop EventReturn MOD_RESULT; FOREACH_RESULT(I_OnPreUserConnect, OnPreUserConnect(*user)); - if (MOD_RESULT == EVENT_STOP) - return *user; - if (Config->LimitSessions && !serv->IsULined()) - add_session(nick, host, user->ip() ? user->ip.addr() : ""); + if (user && MOD_RESULT != EVENT_STOP) + { + if (Config->LimitSessions && !serv->IsULined()) + add_session(nick, host, user->ip() ? user->ip.addr() : ""); - if (!user) - return NULL; + if (!user) + return NULL; - XLineManager::CheckAll(*user); + XLineManager::CheckAll(*user); + } - /* User is no longer connected, return */ if (!user) return NULL;