summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_poll_processing.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-04-05 13:19:05 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-04-05 13:19:05 +0000
commit5413f05df37646178533a24f80e0e0238982af36 (patch)
tree48543bbd8a7da65d3b96e6edbffa6666a5241c47 /protocols/SkypeWeb/src/skype_poll_processing.cpp
parentafd403fdba7bed624cfc03d6053bab370f4bf9db (diff)
SkypeWeb: cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@12610 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_poll_processing.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_poll_processing.cpp38
1 files changed, 17 insertions, 21 deletions
diff --git a/protocols/SkypeWeb/src/skype_poll_processing.cpp b/protocols/SkypeWeb/src/skype_poll_processing.cpp
index fc20ed6683..fd55f67325 100644
--- a/protocols/SkypeWeb/src/skype_poll_processing.cpp
+++ b/protocols/SkypeWeb/src/skype_poll_processing.cpp
@@ -4,14 +4,14 @@ void CSkypeProto::ProcessEndpointPresenceRes(JSONNODE *node)
{
debugLogA("CSkypeProto::ProcessEndpointPresenceRes");
ptrA selfLink(mir_t2a(ptrT(json_as_string(json_get(node, "selfLink")))));
- char *skypename = ContactUrlToName(selfLink);
+ ptrA skypename(ContactUrlToName(selfLink));
if (skypename == NULL)
return;
MCONTACT hContact = GetContact(skypename);
//"publicInfo":{"capabilities":"","typ":"11","skypeNameVersion":"0/7.1.0.105//","nodeInfo":"","version":"24"}
JSONNODE *publicInfo = json_get(node, "publicInfo");
- if (publicInfo != NULL)
+ if (publicInfo != NULL)
{
ptrA skypeNameVersion(mir_t2a(ptrT(json_as_string(json_get(publicInfo, "skypeNameVersion")))));
ptrA version(mir_t2a(ptrT(json_as_string(json_get(publicInfo, "version")))));
@@ -42,9 +42,7 @@ void CSkypeProto::ProcessEndpointPresenceRes(JSONNODE *node)
mir_snprintf(ver, SIZEOF(ver), "%s %s", skypeNameVersion, version);
db_set_s(hContact, m_szModuleName, "MirVer", ver);
}
-
}
-
}
}
@@ -54,18 +52,18 @@ void CSkypeProto::ProcessUserPresenceRes(JSONNODE *node)
ptrA selfLink(mir_t2a(ptrT(json_as_string(json_get(node, "selfLink")))));
ptrA status(mir_t2a(ptrT(json_as_string(json_get(node, "status")))));
- char *skypename = ContactUrlToName(selfLink);
+ ptrA skypename(ContactUrlToName(selfLink));
if (skypename == NULL)
{
- if (IsMe(SelfUrlToName(selfLink)))
+ if (IsMe(ptrA(SelfUrlToName(selfLink))))
{
- int iNewStatus = SkypeToMirandaStatus(status);
- int old_status = m_iStatus;
- m_iDesiredStatus = iNewStatus;
- m_iStatus = iNewStatus;
- if (old_status != iNewStatus)
- ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, iNewStatus);
- return;
+ int iNewStatus = SkypeToMirandaStatus(status);
+ int old_status = m_iStatus;
+ m_iDesiredStatus = iNewStatus;
+ m_iStatus = iNewStatus;
+ if (old_status != iNewStatus)
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, iNewStatus);
+ return;
}
return;
}
@@ -80,17 +78,15 @@ void CSkypeProto::ProcessNewMessageRes(JSONNODE *node)
ptrA messageType(mir_t2a(ptrT(json_as_string(json_get(node, "messagetype")))));
ptrA from(mir_t2a(ptrT(json_as_string(json_get(node, "from")))));
ptrA content(mir_t2a(ptrT(json_as_string(json_get(node, "content")))));
- ptrT composeTime(json_as_string (json_get(node, "composetime")));
+ ptrT composeTime(json_as_string(json_get(node, "composetime")));
ptrA conversationLink(mir_t2a(ptrT(json_as_string(json_get(node, "conversationLink")))));
time_t timestamp = IsoToUnixTime(composeTime);
- char *convname;
if (strstr(conversationLink, "/19:"))
- {
- const char *chatname;
- chatname = ContactUrlToName(conversationLink);
- convname = mir_strdup(chatname);
- return; //chats not supported
- }
+ {
+ const char *chatname;
+ chatname = ContactUrlToName(conversationLink);
+ return; //chats not supported
+ }
else if (strstr(conversationLink, "/8:"))
{
if (!mir_strcmpi(messageType, "Control/Typing"))