diff options
author | George Hazan <ghazan@miranda.im> | 2019-01-26 13:52:36 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-01-26 13:52:36 +0300 |
commit | 2e2483f97aac9b7b3d6819f434377c093d96e764 (patch) | |
tree | ff04d7bc612944717ab08b74d2d851e51fe00e5e /protocols/ICQ-WIM | |
parent | a2fd8ed58e918c4d0edacc96990b69d42bdaa8ba (diff) |
fixes #1801 (ICQ10: stickers support)
Diffstat (limited to 'protocols/ICQ-WIM')
-rw-r--r-- | protocols/ICQ-WIM/src/server.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/protocols/ICQ-WIM/src/server.cpp b/protocols/ICQ-WIM/src/server.cpp index 03c388567a..dbf2e93e7b 100644 --- a/protocols/ICQ-WIM/src/server.cpp +++ b/protocols/ICQ-WIM/src/server.cpp @@ -229,11 +229,21 @@ void CIcqProto::ParseMessage(MCONTACT hContact, __int64 &lastMsgId, const JSONNo if (msgId > lastMsgId) lastMsgId = msgId; + CMStringW wszText; CMStringW type(it["mediaType"].as_mstring()); - if (type != "text" && !type.IsEmpty()) - return; + if (type == "text") + wszText = it["text"].as_mstring(); + else if (type == "sticker") { + CMStringW wszUrl, wszSticker(it["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); + else + wszUrl = TranslateT("Unknown sticker"); + wszText.Format(L"%s\n%s", TranslateT("User sent a sticker:"), wszUrl.c_str()); + } + else return; - CMStringW wszText(it["text"].as_mstring()); if (isChatRoom(hContact)) { CMStringA reqId(it["reqId"].as_mstring()); CheckOwnMessage(reqId, szMsgId, true); |