diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-03-31 18:37:50 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-03-31 18:37:50 +0000 |
commit | f9e66715bee0af7f9b1f2698da1fe11c35479210 (patch) | |
tree | 4cd3f42a1fd45ae54fa623f8758cbdd13d468b8c /protocols/SkypeWeb/src/skype_utils.cpp | |
parent | d3a10049eee36dc0c451cbed542314a94f62ab3c (diff) |
SteamWeb: contact's status support (patch from MikalaiR)
git-svn-id: http://svn.miranda-ng.org/main/trunk@12576 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_utils.cpp')
-rw-r--r-- | protocols/SkypeWeb/src/skype_utils.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
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<char>(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;
+}
|