mirror of
https://github.com/znc/znc.git
synced 2026-05-06 21:42:28 +02:00
Add bAdminOnly and pSkipClient arguments to CZNC::Broadcast
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1070 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
11
znc.cpp
11
znc.cpp
@@ -1573,12 +1573,17 @@ bool CZNC::RemVHost(const CString& sHost) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void CZNC::Broadcast(const CString& sMessage, CUser* pUser) {
|
||||
void CZNC::Broadcast(const CString& sMessage, bool bAdminOnly,
|
||||
CUser* pSkipUser, CClient *pSkipClient) {
|
||||
for (map<CString,CUser*>::iterator a = m_msUsers.begin(); a != m_msUsers.end(); a++) {
|
||||
if (a->second != pUser) {
|
||||
if (bAdminOnly && !a->second->IsAdmin())
|
||||
continue;
|
||||
|
||||
if (a->second != pSkipUser) {
|
||||
CString sMsg = sMessage;
|
||||
|
||||
MODULECALL(OnBroadcast(sMsg), a->second, NULL, continue);
|
||||
a->second->PutStatusNotice("*** " + sMsg);
|
||||
a->second->PutStatusNotice("*** " + sMsg, NULL, pSkipClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
3
znc.h
3
znc.h
@@ -116,7 +116,8 @@ public:
|
||||
void ClearVHosts();
|
||||
bool AddVHost(const CString& sHost);
|
||||
bool RemVHost(const CString& sHost);
|
||||
void Broadcast(const CString& sMessage, CUser* pUser = NULL);
|
||||
void Broadcast(const CString& sMessage, bool bAdminOnly = false,
|
||||
CUser* pSkipUser = NULL, CClient* pSkipClient = NULL);
|
||||
void AddBytesRead(unsigned long long u) { m_uBytesRead += u; }
|
||||
void AddBytesWritten(unsigned long long u) { m_uBytesWritten += u; }
|
||||
unsigned long long BytesRead() const { return m_uBytesRead; }
|
||||
|
||||
Reference in New Issue
Block a user