summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-10-21 19:31:09 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-10-21 19:31:09 +0300
commitc0686493433293210b96c45eddccc3aef95b2592 (patch)
treed126a31fc35e5901742b14df420e53ab0969dd63 /protocols
parent8a406120d56f454a20db346707fac5dd112b1ccb (diff)
temporarily disable prekey removel
Diffstat (limited to 'protocols')
-rw-r--r--protocols/WhatsApp/src/signal.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/protocols/WhatsApp/src/signal.cpp b/protocols/WhatsApp/src/signal.cpp
index c43b8eb8a3..5710392e43 100644
--- a/protocols/WhatsApp/src/signal.cpp
+++ b/protocols/WhatsApp/src/signal.cpp
@@ -196,8 +196,10 @@ static int load_pre_key(signal_buffer **record, uint32_t pre_key_id, void *user_
CMStringA szSetting(FORMAT, "%s%d", "PreKey", pre_key_id);
MBinBuffer blob(pStore->pProto->getBlob(szSetting));
- if (blob.data() == 0)
+ if (blob.data() == 0) {
+ pStore->pProto->debugLogA("Prekey #%d not found", pre_key_id);
return SG_ERR_INVALID_KEY_ID;
+ }
*record = signal_buffer_create((uint8_t *)blob.data(), blob.length());
return SG_SUCCESS; //key exists and succesfully loaded
@@ -206,7 +208,9 @@ static int load_pre_key(signal_buffer **record, uint32_t pre_key_id, void *user_
static int remove_pre_key(uint32_t pre_key_id, void *user_data)
{
auto *pStore = (MSignalStore *)user_data;
+ pStore->pProto->debugLogA("Request to remove prekey #%d", pre_key_id);
+ /*
CMStringA szSetting(FORMAT, "%s%d", "PreKey", pre_key_id);
pStore->pProto->delSetting(szSetting);
@@ -215,6 +219,7 @@ static int remove_pre_key(uint32_t pre_key_id, void *user_data)
szSetting.Format("PreKey%uPrivate", pre_key_id);
pStore->pProto->delSetting(szSetting);
+ */
return 0;
}
@@ -253,8 +258,10 @@ static int load_signed_pre_key(signal_buffer **record, uint32_t signed_pre_key_i
CMStringA szSetting(FORMAT, "%s%d", "SignedPreKey", signed_pre_key_id);
MBinBuffer blob(pStore->pProto->getBlob(szSetting));
- if (blob.data() == 0)
+ if (blob.data() == 0) {
+ pStore->pProto->debugLogA("Signed prekey #%d not found", signed_pre_key_id);
return SG_ERR_INVALID_KEY_ID;
+ }
*record = signal_buffer_create(blob.data(), blob.length());
return SG_SUCCESS; //key exist and succesfully loaded