From f9e66715bee0af7f9b1f2698da1fe11c35479210 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Tue, 31 Mar 2015 18:37:50 +0000 Subject: SteamWeb: contact's status support (patch from MikalaiR) git-svn-id: http://svn.miranda-ng.org/main/trunk@12576 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_utils.cpp | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'protocols/SkypeWeb/src/skype_utils.cpp') diff --git a/protocols/SkypeWeb/src/skype_utils.cpp b/protocols/SkypeWeb/src/skype_utils.cpp index a9a44e1c27..92a7ba792d 100644 --- a/protocols/SkypeWeb/src/skype_utils.cpp +++ b/protocols/SkypeWeb/src/skype_utils.cpp @@ -39,22 +39,23 @@ bool CSkypeProto::IsFileExists(std::tstring path) return false; } -std::string CSkypeProto::urlDecode(std::string SRC) +char *CSkypeProto::ContactUrlToName(const char *url) { - std::string ret; - char ch; - int i, ii; - for (i = 0; i < SRC.length(); i++) + char *tempname = NULL; + const char *start, *end; + start = strstr(url, "/8:"); + + if (!start) + return NULL; + start = start + 3; + if ((end = strchr(start, '/'))) { - if (int(SRC[i]) == 37) - { - sscanf(SRC.substr(i + 1, 2).c_str(), "%x", &ii); - ch = static_cast(ii); - ret += ch; - i = i + 2; - } - else - ret += SRC[i]; + mir_free(tempname); + tempname = mir_strndup(start, end - start); + return tempname; } - return (ret); -} \ No newline at end of file + mir_free(tempname); + tempname = mir_strdup(start); + + return tempname; +} -- cgit v1.2.3