summaryrefslogtreecommitdiff
path: root/protocols/ICQ-WIM/src/server.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-02-06 22:05:29 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-02-06 22:05:29 +0300
commite1c39a211d17ea4c04b62b5eca363194a66f5d11 (patch)
tree6840bd8f3765fe54c545c8f24b1cf509c0a9f057 /protocols/ICQ-WIM/src/server.cpp
parent30e9a15c5487ea1c499806035083f3bf68cf1be3 (diff)
ICQ10: fix for receiving stickers from history
Diffstat (limited to 'protocols/ICQ-WIM/src/server.cpp')
-rw-r--r--protocols/ICQ-WIM/src/server.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp
index be02a2ffe8..06a2f12d33 100644
--- a/protocols/ICQ-WIM/src/server.cpp
+++ b/protocols/ICQ-WIM/src/server.cpp
@@ -327,11 +327,9 @@ void CIcqProto::ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNo
lastMsgId = msgId;
CMStringW wszText;
- CMStringW type(it["mediaType"].as_mstring());
- if (type == "text" || type.IsEmpty())
- wszText = it["text"].as_mstring();
- else if (type == "sticker") {
- CMStringW wszUrl, wszSticker(it["sticker"]["id"].as_mstring());
+ const JSONNode &sticker = it["sticker"];
+ if (sticker) {
+ CMStringW wszUrl, wszSticker(sticker["id"].as_mstring());
int iCollectionId, iStickerId;
if (2 == swscanf(wszSticker, L"ext:%d:sticker:%d", &iCollectionId, &iStickerId))
wszUrl.Format(L"https://c.icq.com/store/stickers/%d/%d/medium", iCollectionId, iStickerId);
@@ -339,7 +337,7 @@ void CIcqProto::ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNo
wszUrl = TranslateT("Unknown sticker");
wszText.Format(L"%s\n%s", TranslateT("User sent a sticker:"), wszUrl.c_str());
}
- else return;
+ else wszText = it["text"].as_mstring();
int iMsgTime = (bFromHistory) ? it["time"].as_int() : time(0);