summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-09-15 14:22:08 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-09-15 14:22:13 +0300
commit67382bca8cdfb020a56dbab3087233c3f1034426 (patch)
treed4cffadcf330cce5527c3b021fcf799f02c17c76 /protocols/JabberG
parentc400f5c17af4996eb2ecf0597e17eb25c17857d8 (diff)
fixes #3674 (Реакция протоколов на отсылку в оффлайн)
Diffstat (limited to 'protocols/JabberG')
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp16
1 files changed, 9 insertions, 7 deletions
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) ||