mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
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
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
#include <znc/User.h>
|
||||
#include <znc/IRCNetwork.h>
|
||||
|
||||
#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<CSimpleAway>(CModInfo& Info) {
|
||||
Info.SetWikiPage("simple_away");
|
||||
}
|
||||
|
||||
MODULEDEFS(CSimpleAway, "Auto away when last client disconnects")
|
||||
NETWORKMODULEDEFS(CSimpleAway, "Auto away when last client disconnects")
|
||||
|
||||
Reference in New Issue
Block a user