summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-11-25 16:32:33 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-11-25 16:32:33 +0300
commit719d49ba7d2484e2ff569c2e6a6203fe52dc40ee (patch)
treeb3e48b8cae520c594b02af97aadad7a7672c43ed /protocols
parent456be9f558f2cf23414bdff1aabd0fb5a4866238 (diff)
fix for applying user devices list to groupchat messages
Diffstat (limited to 'protocols')
-rw-r--r--protocols/WhatsApp/src/message.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/protocols/WhatsApp/src/message.cpp b/protocols/WhatsApp/src/message.cpp
index eef12963f1..2903d40f49 100644
--- a/protocols/WhatsApp/src/message.cpp
+++ b/protocols/WhatsApp/src/message.cpp
@@ -461,9 +461,16 @@ int WhatsAppProto::SendTextMessage(const char *jid, const char *pszMsg)
void WhatsAppProto::FinishTask(WASendTask *pTask)
{
- if (auto *pUser = FindUser(pTask->payLoad.getAttr("to")))
- for (auto &it : pUser->arDevices)
+ if (auto *pUser = FindUser(pTask->payLoad.getAttr("to"))) {
+ if (pUser->bIsGroupChat) {
+ for (auto &it : pUser->si->getUserList())
+ if (auto *pChatUser = FindUser(T2Utf(it->pszUID)))
+ for (auto &cc: pChatUser->arDevices)
+ pTask->arDest.insert(new WAJid(*cc));
+ }
+ else for (auto &it : pUser->arDevices)
pTask->arDest.insert(new WAJid(*it));
+ }
SendTask(pTask);
}