diff options
author | George Hazan <ghazan@miranda.im> | 2022-11-12 21:55:53 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-11-12 21:55:53 +0300 |
commit | 828fd031e79ddbdc663b7841c8225df1f7d22e1d (patch) | |
tree | 7436454e8a5d142744ebf31d97a4b8e98f7e1929 /protocols/WhatsApp | |
parent | f866931f62c5f4027fb68fb12c3fd6531d6b3dd8 (diff) |
WhatsApp: setting correct contact for statuses
Diffstat (limited to 'protocols/WhatsApp')
-rw-r--r-- | protocols/WhatsApp/src/message.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/protocols/WhatsApp/src/message.cpp b/protocols/WhatsApp/src/message.cpp index 3d1bf5e872..ab9da0102a 100644 --- a/protocols/WhatsApp/src/message.cpp +++ b/protocols/WhatsApp/src/message.cpp @@ -192,10 +192,14 @@ void WhatsAppProto::ProcessMessage(WAMSG type, const Wa__WebMessageInfo &msg) debugLogA("Got a message: %s", protobuf_c_text_to_string(&msg).c_str()); uint32_t timestamp = msg.messagetimestamp; - auto *participant = key->participant; - auto *chatId = key->remotejid; + char *participant = key->participant, *chatId; auto *msgId = key->id; + if (type.bPrivateChat || type.bGroupChat) + chatId = key->remotejid; + else + chatId = (participant) ? participant : key->remotejid; + WAUser *pUser = AddUser(chatId, false); if (!key->fromme && msg.pushname && pUser && !pUser->bIsGroupChat) |