summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r--protocols/SkypeWeb/src/main.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_chatrooms.cpp52
-rw-r--r--protocols/SkypeWeb/src/skype_history_sync.cpp26
-rw-r--r--protocols/SkypeWeb/src/skype_messages.cpp26
4 files changed, 52 insertions, 54 deletions
diff --git a/protocols/SkypeWeb/src/main.cpp b/protocols/SkypeWeb/src/main.cpp
index 0d09d03e32..c944b64fb5 100644
--- a/protocols/SkypeWeb/src/main.cpp
+++ b/protocols/SkypeWeb/src/main.cpp
@@ -18,7 +18,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
int hLangpack;
-XML_API xi;
HINSTANCE g_hInstance;
CLIST_INTERFACE *pcli;
char g_szMirVer[100];
@@ -55,7 +54,6 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOC
extern "C" int __declspec(dllexport) Load(void)
{
mir_getLP(&pluginInfo);
- mir_getXI(&xi);
mir_getCLI();
CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(g_szMirVer), LPARAM(g_szMirVer));
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp
index 51b70c307a..eef1c9179f 100644
--- a/protocols/SkypeWeb/src/skype_chatrooms.cpp
+++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp
@@ -293,37 +293,37 @@ void CSkypeProto::OnChatEvent(const JSONNode &node)
ptrA xinitiator, xtarget, initiator;
//content = <addmember><eventtime>1429186229164</eventtime><initiator>8:initiator</initiator><target>8:user</target></addmember>
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("addmember"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("addmember"));
if (xml == NULL)
return;
- for (int i = 0; i < xi.getChildCount(xml); i++)
+ for (int i = 0; i < xmlGetChildCount(xml); i++)
{
- HXML xmlNode = xi.getNthChild(xml, L"target", i);
+ HXML xmlNode = xmlGetNthChild(xml, L"target", i);
if (xmlNode == NULL)
break;
- xtarget = mir_t2a(xi.getText(xmlNode));
+ xtarget = mir_t2a(xmlGetText(xmlNode));
CMStringA target = ParseUrl(xtarget, "8:");
AddChatContact(_A2T(chatname), target, target, L"User");
}
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
}
else if (!mir_strcmpi(messageType.c_str(), "ThreadActivity/DeleteMember"))
{
ptrA xinitiator, xtarget;
//content = <addmember><eventtime>1429186229164</eventtime><initiator>8:initiator</initiator><target>8:user</target></addmember>
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("deletemember"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("deletemember"));
if (xml != NULL) {
- HXML xmlNode = xi.getChildByPath(xml, _T("initiator"), 0);
- xinitiator = node != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL;
+ HXML xmlNode = xmlGetChildByPath(xml, _T("initiator"), 0);
+ xinitiator = node != NULL ? mir_t2a(xmlGetText(xmlNode)) : NULL;
- xmlNode = xi.getChildByPath(xml, _T("target"), 0);
- xtarget = xmlNode != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL;
+ xmlNode = xmlGetChildByPath(xml, _T("target"), 0);
+ xtarget = xmlNode != NULL ? mir_t2a(xmlGetText(xmlNode)) : NULL;
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
}
if (xtarget == NULL)
return;
@@ -337,15 +337,15 @@ void CSkypeProto::OnChatEvent(const JSONNode &node)
{
//content=<topicupdate><eventtime>1429532702130</eventtime><initiator>8:user</initiator><value>test topic</value></topicupdate>
ptrA xinitiator, value;
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("topicupdate"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("topicupdate"));
if (xml != NULL) {
- HXML xmlNode = xi.getChildByPath(xml, _T("initiator"), 0);
- xinitiator = xmlNode != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL;
+ HXML xmlNode = xmlGetChildByPath(xml, _T("initiator"), 0);
+ xinitiator = xmlNode != NULL ? mir_t2a(xmlGetText(xmlNode)) : NULL;
- xmlNode = xi.getChildByPath(xml, _T("value"), 0);
- value = xmlNode != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL;
+ xmlNode = xmlGetChildByPath(xml, _T("value"), 0);
+ value = xmlNode != NULL ? mir_t2a(xmlGetText(xmlNode)) : NULL;
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
}
CMStringA initiator = ParseUrl(xinitiator, "8:");
@@ -356,20 +356,20 @@ void CSkypeProto::OnChatEvent(const JSONNode &node)
{
//content=<roleupdate><eventtime>1429551258363</eventtime><initiator>8:user</initiator><target><id>8:user1</id><role>admin</role></target></roleupdate>
ptrA xinitiator, xId, xRole;
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("roleupdate"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("roleupdate"));
if (xml != NULL) {
- HXML xmlNode = xi.getChildByPath(xml, _T("initiator"), 0);
- xinitiator = xmlNode != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL;
+ HXML xmlNode = xmlGetChildByPath(xml, _T("initiator"), 0);
+ xinitiator = xmlNode != NULL ? mir_t2a(xmlGetText(xmlNode)) : NULL;
- xmlNode = xi.getChildByPath(xml, _T("target"), 0);
+ xmlNode = xmlGetChildByPath(xml, _T("target"), 0);
if (xmlNode != NULL)
{
- HXML xmlId = xi.getChildByPath(xmlNode, _T("id"), 0);
- HXML xmlRole = xi.getChildByPath(xmlNode, _T("role"), 0);
- xId = xmlId != NULL ? mir_t2a(xi.getText(xmlId)) : NULL;
- xRole = xmlRole != NULL ? mir_t2a(xi.getText(xmlRole)) : NULL;
+ HXML xmlId = xmlGetChildByPath(xmlNode, _T("id"), 0);
+ HXML xmlRole = xmlGetChildByPath(xmlNode, _T("role"), 0);
+ xId = xmlId != NULL ? mir_t2a(xmlGetText(xmlId)) : NULL;
+ xRole = xmlRole != NULL ? mir_t2a(xmlGetText(xmlRole)) : NULL;
}
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
CMStringA initiator = ParseUrl(xinitiator, "8:");
CMStringA id = ParseUrl(xId, "8:");
diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp
index c21ee4573a..ef57c93e8a 100644
--- a/protocols/SkypeWeb/src/skype_history_sync.cpp
+++ b/protocols/SkypeWeb/src/skype_history_sync.cpp
@@ -107,19 +107,19 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response)
//content=<partlist type="started" alt=""><part identity="username"><name>user name</name></part></partlist>
int iType = 3, iDuration = 0;
CMStringA skypename(ContactUrlToName(from.c_str()));
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("partlist"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("partlist"));
if (xml != NULL)
{
- ptrA type(mir_t2a(xi.getAttrValue(xml, _T("type"))));
+ ptrA type(mir_t2a(xmlGetAttrValue(xml, _T("type"))));
if (!mir_strcmpi(type, "ended")) iType = 0;
else if (!mir_strcmpi(type, "started")) iType = 1;
- HXML xmlNode = xi.getChildByPath(xml, _T("part"), 0);
- HXML duration = xmlNode == NULL ? NULL : xi.getChildByPath(xmlNode, _T("duration"), 0);
- iDuration = duration != NULL ? atoi(mir_t2a(xi.getText(duration))) : NULL;
+ HXML xmlNode = xmlGetChildByPath(xml, _T("part"), 0);
+ HXML duration = xmlNode == NULL ? NULL : xmlGetChildByPath(xmlNode, _T("duration"), 0);
+ iDuration = duration != NULL ? atoi(mir_t2a(xmlGetText(duration))) : NULL;
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
}
CMStringA text = "";
if (iType == 1)
@@ -147,17 +147,17 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response)
else if (!mir_strcmpi(messageType.c_str(), "RichText/Files"))
{
//content=<files alt="отправил (-а) файл &quot;run.bat&quot;"><file size="97" index="0" tid="4197760077">run.bat</file></files>
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("files"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("files"));
if (xml != NULL)
{
- for (int i = 0; i < xi.getChildCount(xml); i++)
+ for (int i = 0; i < xmlGetChildCount(xml); i++)
{
int fileSize; CMStringA msg = "";
- HXML xmlNode = xi.getNthChild(xml, L"file", i);
+ HXML xmlNode = xmlGetNthChild(xml, L"file", i);
if (xmlNode == NULL)
break;
- fileSize = atoi(_T2A(xi.getAttrValue(xmlNode, L"size")));
- ptrA fileName(mir_t2a(xi.getText(xmlNode)));
+ fileSize = atoi(_T2A(xmlGetAttrValue(xmlNode, L"size")));
+ ptrA fileName(mir_t2a(xmlGetText(xmlNode)));
if (fileName == NULL || fileSize == NULL)
continue;
@@ -170,10 +170,10 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response)
else if (!mir_strcmpi(messageType.c_str(), "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.c_str())), 0, _T("URIObject"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("URIObject"));
if (xml != NULL)
{
- CMStringA object(ParseUrl(_T2A(xi.getAttrValue(xml, L"uri")), "/objects/"));
+ CMStringA object(ParseUrl(_T2A(xmlGetAttrValue(xml, L"uri")), "/objects/"));
CMStringA data(FORMAT, "%s: https://api.asm.skype.com/s/i?%s", Translate("Image"), object.c_str());
AddMessageToDb(hContact, timestamp, flags, clientMsgId.c_str(), data.GetBuffer());
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp
index cdd86adf49..87ed6a37fe 100644
--- a/protocols/SkypeWeb/src/skype_messages.cpp
+++ b/protocols/SkypeWeb/src/skype_messages.cpp
@@ -199,20 +199,20 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node)
//<part identity="echo123"><name>Echo / Sound Test Service</name><duration>6</duration></part></partlist>
//content=<partlist type="started" alt=""><part identity="username"><name>user name</name></part></partlist>
int iType = 3, iDuration = 0;
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("partlist"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("partlist"));
if (xml != NULL)
{
- ptrA type(mir_t2a(xi.getAttrValue(xml, _T("type"))));
+ ptrA type(mir_t2a(xmlGetAttrValue(xml, _T("type"))));
if (!mir_strcmpi(type, "ended")) iType = 0;
else if (!mir_strcmpi(type, "started")) iType = 1;
- HXML xmlNode = xi.getChildByPath(xml, _T("part"), 0);
- HXML duration = xmlNode == NULL ? NULL : xi.getChildByPath(xmlNode, _T("duration"), 0);
- iDuration = duration != NULL ? atoi(mir_t2a(xi.getText(duration))) : NULL;
+ HXML xmlNode = xmlGetChildByPath(xml, _T("part"), 0);
+ HXML duration = xmlNode == NULL ? NULL : xmlGetChildByPath(xmlNode, _T("duration"), 0);
+ iDuration = duration != NULL ? atoi(mir_t2a(xmlGetText(duration))) : NULL;
- xi.destroyNode(xml);
+ xmlDestroyNode(xml);
}
CMStringA text = "";
if (iType == 1)
@@ -244,17 +244,17 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node)
else if (!mir_strcmpi(messageType.c_str(), "RichText/Files"))
{
//content=<files alt="отправил (-а) файл &quot;run.bat&quot;"><file size="97" index="0" tid="4197760077">run.bat</file></files>
- HXML xml = xi.parseString(ptrT(mir_a2t(content.c_str())), 0, _T("files"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("files"));
if (xml != NULL)
{
- for (int i = 0; i < xi.getChildCount(xml); i++)
+ for (int i = 0; i < xmlGetChildCount(xml); i++)
{
int fileSize;
- HXML xmlNode = xi.getNthChild(xml, _T("file"), i);
+ HXML xmlNode = xmlGetNthChild(xml, _T("file"), i);
if (xmlNode == NULL)
break;
- fileSize = atoi(_T2A(xi.getAttrValue(xmlNode, _T("size"))));
- ptrA fileName(mir_utf8encodeT(xi.getText(xmlNode)));
+ fileSize = atoi(_T2A(xmlGetAttrValue(xmlNode, _T("size"))));
+ ptrA fileName(mir_utf8encodeT(xmlGetText(xmlNode)));
if (fileName == NULL || fileSize == NULL)
continue;
@@ -267,10 +267,10 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node)
else if (!mir_strcmpi(messageType.c_str(), "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.c_str())), 0, _T("URIObject"));
+ HXML xml = xmlParseString(ptrT(mir_a2t(content.c_str())), 0, _T("URIObject"));
if (xml != NULL)
{
- CMStringA object(ParseUrl(_T2A(xi.getAttrValue(xml, L"uri")), "/objects/"));
+ CMStringA object(ParseUrl(_T2A(xmlGetAttrValue(xml, L"uri")), "/objects/"));
CMStringA data(FORMAT, "%s: https://api.asm.skype.com/s/i?%s", Translate("Image"), object.c_str());
AddMessageToDb(hContact, timestamp, DBEF_UTF, clientMsgId.c_str(), data.GetBuffer());
}