summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_proto.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2017-08-17 20:26:39 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2017-08-17 20:30:46 +0300
commit600f344d88bec6dd61aa123be1d2114bffbdf493 (patch)
treee6719b81af54fa89ecf68423298fe01158c00f08 /protocols/JabberG/src/jabber_proto.cpp
parent3146b42058bccddb648c2a5d8bfc189ae6ad1dd2 (diff)
jabber: omemo: working on TODO
implemented message queue for messages received/sendt before omemo sessions created //this solve problem with loosing first message
Diffstat (limited to 'protocols/JabberG/src/jabber_proto.cpp')
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 2b587e2415..cba4d8cdeb 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -905,7 +905,7 @@ void __cdecl CJabberProto::SendMessageAckThread(void* param)
static char PGP_PROLOG[] = "-----BEGIN PGP MESSAGE-----\r\n\r\n";
static char PGP_EPILOG[] = "\r\n-----END PGP MESSAGE-----\r\n";
-int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
+int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int unused_unknown, const char* pszSrc)
{
wchar_t szClientJid[JABBER_MAX_JID_LEN];
if (!m_bJabberOnline || !GetClientJID(hContact, szClientJid, _countof(szClientJid))) {
@@ -916,11 +916,13 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
if (m_options.UseOMEMO)
{
- if (!OmemoCheckSession(hContact)) //check omemo session state and build new session if necessary //TODO: something better
+ if (!OmemoCheckSession(hContact))
{
- TFakeAckParams *param = new TFakeAckParams(hContact, Translate("OMEMO session does not exist yet"));
+ OmemoPutMessageToOutgoingQueue(hContact, unused_unknown, pszSrc);
+ int id = SerialNext();
+ TFakeAckParams *param = new TFakeAckParams(hContact, 0, id);
ForkThread(&CJabberProto::SendMessageAckThread, param);
- return 0;
+ return id;
}
}