summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_proto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/JabberG/src/jabber_proto.cpp')
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 4635288ee8..f5df6dbc9a 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -964,7 +964,13 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
if(m_options.UseOMEMO && OmemoIsEnabled(hContact) && !mir_wstrcmp(msgType, L"chat")) //omemo enabled in options, omemo enabled for contact
{
- OmemoEncryptMessage(m, msg, hContact);
+ //TODO: check if message encrypted for at least one session and return error if not
+ if (!OmemoEncryptMessage(m, msg, hContact))
+ {
+ TFakeAckParams *param = new TFakeAckParams(hContact, Translate("OMEMO no valid sessions exists"));
+ ForkThread(&CJabberProto::SendMessageAckThread, param);
+ return 0;
+ }
}
else
{