From ec581a63174f22a07d9fcdb37711db8fe84337aa Mon Sep 17 00:00:00 2001 From: cflakes Date: Sun, 10 Jan 2010 11:52:47 +0000 Subject: [PATCH] Small update to extra/notify_connect: - Added a proper description - Fixed bracing style - Removed unneeded headers - Added client IP addresses to info messages. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1699 726aef4b-f618-498e-8847-2d620e286838 --- modules/extra/notify_connect.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/modules/extra/notify_connect.cpp b/modules/extra/notify_connect.cpp index 44f7dfd7..5b712339 100644 --- a/modules/extra/notify_connect.cpp +++ b/modules/extra/notify_connect.cpp @@ -6,32 +6,25 @@ * by the Free Software Foundation. */ -#include "main.h" -#include "User.h" -#include "Nick.h" -#include "Modules.h" -#include "Chan.h" #include "znc.h" +#include "User.h" class CNotifyConnectMod : public CGlobalModule { public: GLOBALMODCONSTRUCTOR(CNotifyConnectMod) {} - virtual void OnClientLogin() - { - SendAdmins(m_pUser->GetUserName() + " attached"); + virtual void OnClientLogin() { + SendAdmins(m_pUser->GetUserName() + " attached (from " + m_pClient->GetRemoteIP() + ")"); } - virtual void OnClientDisconnect() - { - SendAdmins(m_pUser->GetUserName() + " detached"); + virtual void OnClientDisconnect() { + SendAdmins(m_pUser->GetUserName() + " detached (gone: " + m_pClient->GetRemoteIP() + ")"); } private: - void SendAdmins(const CString &msg) - { + void SendAdmins(const CString &msg) { CZNC::Get().Broadcast(msg, true, NULL, GetClient()); } }; -GLOBALMODULEDEFS(CNotifyConnectMod, ""); +GLOBALMODULEDEFS(CNotifyConnectMod, "Notifies all admin users when a client connects or disconnects.");