diff options
-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); |