summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-11-16 20:17:10 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-11-16 20:17:10 +0300
commitec6ddc5feabf87a067ea22bea943befb169a8684 (patch)
treeb07801d76e038753bb7887ff0d91ef120bac7077
parent3dcba5c9f24d127b538051bc0b9fcf3d59cb84aa (diff)
Sh-h-hit...
-rw-r--r--protocols/WhatsApp/src/signal.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/protocols/WhatsApp/src/signal.cpp b/protocols/WhatsApp/src/signal.cpp
index 16d6c47df5..5ad985db27 100644
--- a/protocols/WhatsApp/src/signal.cpp
+++ b/protocols/WhatsApp/src/signal.cpp
@@ -504,8 +504,8 @@ CMStringA MSignalSession::getSetting() const
MSignalSession* MSignalStore::createSession(const CMStringA &szName, int deviceId)
{
- MSignalSession tmp(szName, deviceId);
- auto *pSession = arSessions.find(&tmp);
+ signal_protocol_address tmp = {szName.c_str(), szName.GetLength(), deviceId};
+ auto *pSession = getSession(&tmp);
if (pSession == nullptr) {
pSession = new MSignalSession(szName, deviceId);
arSessions.insert(pSession);
@@ -541,7 +541,7 @@ MSignalSession* MSignalStore::getSession(const signal_protocol_address *address)
MBinBuffer MSignalStore::decryptSignalProto(const CMStringA &from, const char *pszType, const MBinBuffer &encrypted)
{
WAJid jid(from);
- auto *pSession = createSession(jid.user, 0);
+ auto *pSession = createSession(jid.user, jid.device);
signal_buffer *result = nullptr;
if (!mir_strcmp(pszType, "pkmsg")) {