diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-09 09:09:29 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-09 09:09:29 +0000 |
commit | 45898e008336c419f9d4b07ccfa46fde30226db0 (patch) | |
tree | 1a3ea8a7e16df2005226c95948f50d5f9e8411ae /protocols/SkypeWeb/src/skype_poll_processing.cpp | |
parent | 37293d2f4ab8a9ed5cb90ae606ff96f01bd72f78 (diff) |
SkypeWeb: fix mirver, more optimizations
git-svn-id: http://svn.miranda-ng.org/main/trunk@14880 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_poll_processing.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_poll_processing.cpp | 85 |
1 files changed, 35 insertions, 50 deletions
diff --git a/protocols/SkypeWeb/src/skype_poll_processing.cpp b/protocols/SkypeWeb/src/skype_poll_processing.cpp index 06390a3a62..b005047d69 100644 --- a/protocols/SkypeWeb/src/skype_poll_processing.cpp +++ b/protocols/SkypeWeb/src/skype_poll_processing.cpp @@ -22,8 +22,6 @@ void CSkypeProto::ProcessEndpointPresenceRes(const JSONNode &node) debugLogA("CSkypeProto::ProcessEndpointPresenceRes");
std::string selfLink = node["selfLink"].as_string();
CMStringA skypename(UrlToSkypename(selfLink.c_str()));
- if (skypename.IsEmpty())
- return;
MCONTACT hContact = FindContact(skypename);
if (hContact == NULL)
@@ -31,61 +29,48 @@ void CSkypeProto::ProcessEndpointPresenceRes(const JSONNode &node) const JSONNode &publicInfo = node["publicInfo"];
const JSONNode &privateInfo = node["privateInfo"];
- CMStringA MirVer = "";
+ CMStringA MirVer;
if (publicInfo)
{
std::string skypeNameVersion = publicInfo["skypeNameVersion"].as_string();
std::string version = publicInfo["version"].as_string();
std::string typ = publicInfo["typ"].as_string();
- if (!typ.empty())
+ int iTyp = atoi(typ.c_str());
+ switch (iTyp)
{
- int iTyp = atoi(typ.c_str());
- switch (iTyp)
- {
- case 17:
- MirVer.Append("Skype (Android)");
- break;
- case 16:
- MirVer.Append("Skype (iOS)");
- break;
- case 12:
- MirVer.Append("Skype (WinRT)");
- break;
- case 15:
- MirVer.Append("Skype (WP)");
- break;
- case 13:
- MirVer.Append("Skype (OSX)");
+ case 0:
+ case 1:
+ MirVer.AppendFormat("Skype (Web) %s", ParseUrl(version.c_str(), "/"));
+ break;
+ case 10:
+ MirVer.AppendFormat("Skype (XBOX) %s", ParseUrl(skypeNameVersion.c_str(), "/"));
+ break;
+ case 17:
+ MirVer.AppendFormat("Skype (Android) %s", ParseUrl(skypeNameVersion.c_str(), "/"));
+ break;
+ case 16:
+ MirVer.AppendFormat("Skype (iOS) %s", ParseUrl(skypeNameVersion.c_str(), "/"));
+ break;
+ case 12:
+ MirVer.AppendFormat("Skype (WinRT) %s", ParseUrl(skypeNameVersion.c_str(), "/"));
+ break;
+ case 15:
+ MirVer.AppendFormat("Skype (WP) %s", ParseUrl(skypeNameVersion.c_str(), "/"));
+ break;
+ case 13:
+ MirVer.AppendFormat("Skype (OSX) %s", ParseUrl(skypeNameVersion.c_str(), "/"));
break;
- case 11:
- MirVer.Append("Skype (Windows)");
- break;
- case 14:
- MirVer.Append("Skype (Linux)");
- break;
- case 10:
- MirVer.Append("Skype (XBOX)");
- break;
- case 1:
- MirVer.Append("Skype (Web)");
- break;
- case 125:
- MirVer.Append("Miranda NG Skype");
- break;
- default:
- {
- if (!mir_strcmpi(typ.c_str(), "website"))
- MirVer.Append("Skype (Outlook)");
- else
- MirVer.Append("Skype (Unknown)");
- break;
- }
- }
- MirVer.AppendChar(' ');
- if (iTyp == 125)
- MirVer.Append(version.c_str());
- else
- MirVer.Append(ParseUrl(skypeNameVersion.c_str(), "/"));
+ case 11:
+ MirVer.AppendFormat("Skype (Windows) %s", ParseUrl(skypeNameVersion.c_str(), "/"));
+ break;
+ case 14:
+ MirVer.AppendFormat("Skype (Linux) %s", ParseUrl(skypeNameVersion.c_str(), "/"));
+ break;
+ case 125:
+ MirVer.AppendFormat("Miranda NG Skype %s", version.c_str());
+ break;
+ default:
+ MirVer.Append("Skype (Unknown)");
}
}
if (privateInfo != NULL)
|