mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
- 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
31 lines
874 B
C++
31 lines
874 B
C++
/*
|
|
* Copyright (C) 2004-2010 See the AUTHORS file for details.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License version 2 as published
|
|
* by the Free Software Foundation.
|
|
*/
|
|
|
|
#include "znc.h"
|
|
#include "User.h"
|
|
|
|
class CNotifyConnectMod : public CGlobalModule {
|
|
public:
|
|
GLOBALMODCONSTRUCTOR(CNotifyConnectMod) {}
|
|
|
|
virtual void OnClientLogin() {
|
|
SendAdmins(m_pUser->GetUserName() + " attached (from " + m_pClient->GetRemoteIP() + ")");
|
|
}
|
|
|
|
virtual void OnClientDisconnect() {
|
|
SendAdmins(m_pUser->GetUserName() + " detached (gone: " + m_pClient->GetRemoteIP() + ")");
|
|
}
|
|
|
|
private:
|
|
void SendAdmins(const CString &msg) {
|
|
CZNC::Get().Broadcast(msg, true, NULL, GetClient());
|
|
}
|
|
};
|
|
|
|
GLOBALMODULEDEFS(CNotifyConnectMod, "Notifies all admin users when a client connects or disconnects.");
|