summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-02-27 13:44:38 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-02-27 13:44:38 +0300
commitcf5d89144da7ceed41fe9a45ed61c872452639a4 (patch)
tree4854f09f313125a6eb30962a7e18b88aaeab0215 /protocols/ICQ-WIM/src
parent423be683866fd8e305457eb725d8cdbe1f297fbd (diff)
fixes #1839 (SecureIM detection in ICQ-WIM)
Diffstat (limited to 'protocols/ICQ-WIM/src')
-rw-r--r--protocols/ICQ-WIM/src/proto.h2
-rw-r--r--protocols/ICQ-WIM/src/server.cpp15
2 files changed, 9 insertions, 8 deletions
diff --git a/protocols/ICQ-WIM/src/proto.h b/protocols/ICQ-WIM/src/proto.h
index ea5f310dbb..8125aae649 100644
--- a/protocols/ICQ-WIM/src/proto.h
+++ b/protocols/ICQ-WIM/src/proto.h
@@ -48,7 +48,7 @@
#define WIM_CAP_MAIL_NOTIFICATIONS "094613594c7f11d18222444553540000"
#define WIM_CAP_INTRO_DLG_STATE "0946135a4c7f11d18222444553540000"
-#define NG_CAP_SECUREIM "4D69724E47536563757265494D000000"
+#define NG_CAP_SECUREIM "4d69724e47536563757265494d000000"
typedef CProtoDlgBase<CIcqProto> CIcqDlgBase;
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp
index f33d22eb1d..a960bb1d95 100644
--- a/protocols/ICQ-WIM/src/server.cpp
+++ b/protocols/ICQ-WIM/src/server.cpp
@@ -227,7 +227,7 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact)
}
CMStringA szVer;
- bool bVersionDetected = false;
+ bool bVersionDetected = false, bSecureIM = false;
for (auto &it : buddy["capabilities"]) {
CMStringW wszCap(it.as_mstring());
@@ -243,9 +243,8 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact)
setString(hContact, "MirVer", szVer);
bVersionDetected = true;
}
- else if (!memcmp(cap, NG_CAP_SECUREIM, 16)) {
- szVer.Append(" + SecureIM");
- bVersionDetected = true;
+ else if (wszCap == _A2W(NG_CAP_SECUREIM)) {
+ bSecureIM = bVersionDetected = true;
}
else if (!memcmp(cap, "Mod by Mikanoshi", 16)) {
szVer = "R&Q build by Mikanoshi";
@@ -257,10 +256,12 @@ MCONTACT CIcqProto::ParseBuddyInfo(const JSONNode &buddy, MCONTACT hContact)
}
}
- if (bVersionDetected)
+ if (bVersionDetected) {
+ if (bSecureIM)
+ szVer.Append(" + SecureIM");
setString(hContact, "MirVer", szVer);
- else
- delSetting(hContact, "MirVer");
+ }
+ else delSetting(hContact, "MirVer");
CMStringW str(buddy["state"].as_mstring());
setDword(hContact, "Status", StatusFromString(str));