diff options
author | George Hazan <ghazan@miranda.im> | 2023-01-28 19:58:25 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-01-28 19:58:25 +0300 |
commit | 3e00af6e0b04bca9e5398f250c7dd4280da608cc (patch) | |
tree | c435ee6859581a5226a9af4bcc989cf07196d115 /protocols/IRCG/src/tools.cpp | |
parent | 11fbe8d4d458c856dcbf7e6d18561b467ef368d3 (diff) |
IRC: fix for event broadcasting
Diffstat (limited to 'protocols/IRCG/src/tools.cpp')
-rw-r--r-- | protocols/IRCG/src/tools.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp index 4748f34534..89dff93034 100644 --- a/protocols/IRCG/src/tools.cpp +++ b/protocols/IRCG/src/tools.cpp @@ -378,26 +378,31 @@ INT_PTR CIrcProto::DoEvent(int iEvent, const wchar_t *pszWindow, const wchar_t * const wchar_t *pszText, const wchar_t *pszStatus, const wchar_t *pszUserInfo,
DWORD_PTR dwItemData, bool bAddToLog, bool bIsMe, time_t timestamp)
{
- CMStringW sID;
- CMStringW sText;
-
if (iEvent == GC_EVENT_INFORMATION && bIsMe && !bEcho)
return false;
+ CMStringW sText;
if (pszText)
sText = DoColorCodes(pszText, FALSE, TRUE);
- GCEVENT gce = { 0, iEvent };
- if (pszWindow) {
- sID = pszWindow;
- gce.si = Chat_Find(sID.c_str(), m_szModuleName);
+ GCEVENT gce = {};
+ if (pszWindow)
+ gce.si = Chat_Find(pszWindow, m_szModuleName);
+ else {
+ gce.pszModule = m_szModuleName;
+ gce.dwFlags |= GCEF_BROADCAST;
}
- else gce.si = nullptr;
+ if (bAddToLog)
+ gce.dwFlags |= GCEF_ADDTOLOG;
+
+ gce.iType = iEvent;
gce.pszStatus.w = pszStatus;
- gce.dwFlags = (bAddToLog) ? GCEF_ADDTOLOG : 0;
gce.pszNick.w = pszNick;
gce.pszUID.w = pszNick;
+ gce.dwItemData = dwItemData;
+ gce.bIsMe = bIsMe;
+
if (iEvent == GC_EVENT_TOPIC)
gce.pszUserInfo.w = pszUserInfo;
else
@@ -406,12 +411,10 @@ INT_PTR CIrcProto::DoEvent(int iEvent, const wchar_t *pszWindow, const wchar_t * if (!sText.IsEmpty())
gce.pszText.w = sText.c_str();
- gce.dwItemData = dwItemData;
if (timestamp == 1)
gce.time = time(0);
else
gce.time = timestamp;
- gce.bIsMe = bIsMe;
return Chat_Event(&gce);
}
|