From 67382bca8cdfb020a56dbab3087233c3f1034426 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 15 Sep 2023 14:22:08 +0300 Subject: =?UTF-8?q?fixes=20#3674=20(=D0=A0=D0=B5=D0=B0=D0=BA=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BF=D1=80=D0=BE=D1=82=D0=BE=D0=BA=D0=BE=D0=BB=D0=BE?= =?UTF-8?q?=D0=B2=20=D0=BD=D0=B0=20=D0=BE=D1=82=D1=81=D1=8B=D0=BB=D0=BA?= =?UTF-8?q?=D1=83=20=D0=B2=20=D0=BE=D1=84=D1=84=D0=BB=D0=B0=D0=B9=D0=BD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/JabberG/src/jabber_proto.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'protocols/JabberG') diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index af2ccc5e94..bc038bb3fc 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -893,11 +893,12 @@ int CJabberProto::SendMsg(MCONTACT hContact, int /*flags*/, const char *pszSrc) int CJabberProto::SendMsgEx(MCONTACT hContact, const char *pszSrc, XmlNode &m) { - char szClientJid[JABBER_MAX_JID_LEN]; - if (!m_bJabberOnline || !GetClientJID(hContact, szClientJid, _countof(szClientJid))) { - ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, 0, (LPARAM)TranslateT("Protocol is offline or no JID")); + if (!m_bJabberOnline) return -1; - } + + char szClientJid[JABBER_MAX_JID_LEN]; + if (!GetClientJID(hContact, szClientJid, _countof(szClientJid))) + return 0; if (OmemoIsEnabled(hContact)) { if (!OmemoCheckSession(hContact, true)) { @@ -909,16 +910,16 @@ int CJabberProto::SendMsgEx(MCONTACT hContact, const char *pszSrc, XmlNode &m) } CMStringA szBody; - int isEncrypted, id = SerialNext(); + bool isEncrypted; if (!strncmp(pszSrc, PGP_PROLOG, mir_strlen(PGP_PROLOG))) { const char *szEnd = strstr(pszSrc, PGP_EPILOG); size_t nStrippedLength = mir_strlen(pszSrc) - mir_strlen(PGP_PROLOG) - (szEnd ? mir_strlen(szEnd) : 0) + 1; szBody.Append(pszSrc + mir_strlen(PGP_PROLOG), (int)nStrippedLength); szBody.Replace("\r\n", ""); pszSrc = szBody; - isEncrypted = 1; + isEncrypted = true; } - else isEncrypted = 0; + else isEncrypted = false; char *msgType; if (ListGetItemPtr(LIST_CHATROOM, szClientJid) && strchr(szClientJid, '/') == nullptr) @@ -959,6 +960,7 @@ int CJabberProto::SendMsgEx(MCONTACT hContact, const char *pszSrc, XmlNode &m) m << XCHILDNS("markable", JABBER_FEAT_CHAT_MARKERS); } + int id = SerialNext(); if ( // if message delivery check disabled by entity caps manager (jcb & JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY) || -- cgit v1.2.3