Make CUser::Put* send to all clients

Instead of only networkless clients, which is a very rare case, because
most clients are connected to some network. This resulted in
CModule::PutModule to sometimes have no effect.

I fixed CUser::PutStatus and PutStatusNotice back in 2011 in
0b6d609014, but missed these 3 functions.

Deprecate CUser::PutAllUser() which is now essentially alias to
CUser::PutUser().
pull/1838/head
Alexey Sokolov 3 months ago
parent 32d4a4d580
commit c55237be0b

@ -93,7 +93,10 @@ class CUser : private CCoreTranslationMixin {
bool PutUser(const CString& sLine, CClient* pClient = nullptr,
CClient* pSkipClient = nullptr);
bool PutAllUser(const CString& sLine, CClient* pClient = nullptr,
CClient* pSkipClient = nullptr);
CClient* pSkipClient = nullptr)
ZNC_MSG_DEPRECATED("Use PutUser() instead") {
return PutUser(sLine, pClient, pSkipClient);
}
bool PutStatus(const CString& sLine, CClient* pClient = nullptr,
CClient* pSkipClient = nullptr);
bool PutStatusNotice(const CString& sLine, CClient* pClient = nullptr,

@ -1105,13 +1105,6 @@ bool CUser::PutUser(const CString& sLine, CClient* pClient,
}
}
return (pClient == nullptr);
}
bool CUser::PutAllUser(const CString& sLine, CClient* pClient,
CClient* pSkipClient) {
PutUser(sLine, pClient, pSkipClient);
for (CIRCNetwork* pNetwork : m_vIRCNetworks) {
if (pNetwork->PutUser(sLine, pClient, pSkipClient)) {
return true;
@ -1157,7 +1150,7 @@ bool CUser::PutStatusNotice(const CString& sLine, CClient* pClient,
bool CUser::PutModule(const CString& sModule, const CString& sLine,
CClient* pClient, CClient* pSkipClient) {
for (CClient* pEachClient : m_vClients) {
for (CClient* pEachClient : GetAllClients()) {
if ((!pClient || pClient == pEachClient) &&
pSkipClient != pEachClient) {
pEachClient->PutModule(sModule, sLine);
@ -1173,7 +1166,7 @@ bool CUser::PutModule(const CString& sModule, const CString& sLine,
bool CUser::PutModNotice(const CString& sModule, const CString& sLine,
CClient* pClient, CClient* pSkipClient) {
for (CClient* pEachClient : m_vClients) {
for (CClient* pEachClient : GetAllClients()) {
if ((!pClient || pClient == pEachClient) &&
pSkipClient != pEachClient) {
pEachClient->PutModNotice(sModule, sLine);

Loading…
Cancel
Save