diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-05-06 15:50:37 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-05-06 15:50:37 +0000 |
commit | 55dde6fae68e9ab0f773db446a9bf3d00c08847e (patch) | |
tree | 77a50ab47a7e66bf17e45904ae40719488b1c04d /protocols | |
parent | 84f37f33494eb0d22a67c59dc58b3bca2bb676c7 (diff) |
SkypeWeb: Receiving images.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13464 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/SkypeWeb/src/skype_history_sync.cpp | 10 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_messages.cpp | 10 |
2 files changed, 18 insertions, 2 deletions
diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp index 8ea67df14e..fc855687af 100644 --- a/protocols/SkypeWeb/src/skype_history_sync.cpp +++ b/protocols/SkypeWeb/src/skype_history_sync.cpp @@ -170,6 +170,16 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response) }
}
}
+ else if (!mir_strcmpi(messageType, "RichText/UriObject"))
+ {
+ //content=<URIObject type="Picture.1" uri="https://api.asm.skype.com/v1//objects/0-weu-d1-262f0a1ee256d03b8e4b8360d9208834" url_thumbnail="https://api.asm.skype.com/v1//objects/0-weu-d1-262f0a1ee256d03b8e4b8360d9208834/views/imgt1"><Title></Title><Description></Description>Для просмотра этого общего фото перейдите по ссылке: https://api.asm.skype.com/s/i?0-weu-d1-262f0a1ee256d03b8e4b8360d9208834<meta type="photo" originalName="ysd7ZE4BqOg.jpg"/><OriginalName v="ysd7ZE4BqOg.jpg"/></URIObject>
+ HXML xml = xi.parseString(ptrT(mir_a2t(content)), 0, _T("URIObject"));
+ if (xml != NULL)
+ {
+ ptrA url(mir_t2a(xi.getAttrValue(xml, L"url_thumbnail")));
+ AddMessageToDb(hContact, timestamp, flags, clientMsgId, url);
+ }
+ } //Picture
}
else if (conversationLink != NULL && strstr(conversationLink, "/19:"))
{
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp index 5e68bfcfad..63c74cac9c 100644 --- a/protocols/SkypeWeb/src/skype_messages.cpp +++ b/protocols/SkypeWeb/src/skype_messages.cpp @@ -366,11 +366,17 @@ void CSkypeProto::OnPrivateMessageEvent(JSONNODE *node) else if (!mir_strcmpi(messageType, "RichText/Location")){}
else if (!mir_strcmpi(messageType, "RichText/UriObject"))
{
-
+ //content=<URIObject type="Picture.1" uri="https://api.asm.skype.com/v1//objects/0-weu-d1-262f0a1ee256d03b8e4b8360d9208834" url_thumbnail="https://api.asm.skype.com/v1//objects/0-weu-d1-262f0a1ee256d03b8e4b8360d9208834/views/imgt1"><Title></Title><Description></Description>Для просмотра этого общего фото перейдите по ссылке: https://api.asm.skype.com/s/i?0-weu-d1-262f0a1ee256d03b8e4b8360d9208834<meta type="photo" originalName="ysd7ZE4BqOg.jpg"/><OriginalName v="ysd7ZE4BqOg.jpg"/></URIObject>
+ HXML xml = xi.parseString(ptrT(mir_a2t(content)), 0, _T("URIObject"));
+ if (xml != NULL)
+ {
+ ptrA url(mir_t2a(xi.getAttrValue(xml, L"url_thumbnail")));
+ AddMessageToDb(hContact, timestamp, DBEF_UTF, clientMsgId, url);
+ }
} //Picture
else if (!mir_strcmpi(messageType, "RichText/Contacts")){}
- if (clientMsgId)
+ if (clientMsgId && (!mir_strcmpi(messageType, "Text") || !mir_strcmpi(messageType, "RichText")))
{
PushRequest(new MarkMessageReadRequest(skypename, RegToken, _ttoi(json_as_string(json_get(node, "id"))), timestamp, false, Server));
}
|