From a8cb7697cf3d1cf4da607106632c581dcf0353e5 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Wed, 19 Oct 2011 09:55:10 +0100 Subject: [PATCH] simple_away: check if the network is attached instead of the user Also make simple_away a network module, so that when the timer fires we have a network to send the AWAY lines Fixes #77 --- modules/simple_away.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/simple_away.cpp b/modules/simple_away.cpp index bb695c8f..8587401e 100644 --- a/modules/simple_away.cpp +++ b/modules/simple_away.cpp @@ -7,6 +7,7 @@ */ #include +#include #define SIMPLE_AWAY_DEFAULT_REASON "Auto away at %s" #define SIMPLE_AWAY_DEFAULT_TIME 60 @@ -73,7 +74,7 @@ public: } virtual void OnIRCConnected() { - if (m_pUser->IsUserAttached()) + if (m_pNetwork->IsUserAttached()) SetBack(); else SetAway(false); @@ -85,7 +86,7 @@ public: virtual void OnClientDisconnect() { /* There might still be other clients */ - if (!m_pUser->IsUserAttached()) + if (!m_pNetwork->IsUserAttached()) SetAway(); } @@ -220,4 +221,4 @@ template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("simple_away"); } -MODULEDEFS(CSimpleAway, "Auto away when last client disconnects") +NETWORKMODULEDEFS(CSimpleAway, "Auto away when last client disconnects")