summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_utils.cpp
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-04-20 15:03:07 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-04-20 15:03:07 +0000
commite79b2d652e8a868b2605a24b1f3796b32e6ea0c9 (patch)
treefd00a4740adb703551783f6932bf3e968ac267e5 /protocols/SkypeWeb/src/skype_utils.cpp
parentf69bcfd21fd923fe70dd0c6412d0421bd62047a1 (diff)
SkypeWeb: AssocMgr support part 1.
git-svn-id: http://svn.miranda-ng.org/main/trunk@12978 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_utils.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_utils.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/protocols/SkypeWeb/src/skype_utils.cpp b/protocols/SkypeWeb/src/skype_utils.cpp
index ca2fb11989..165a48cdf0 100644
--- a/protocols/SkypeWeb/src/skype_utils.cpp
+++ b/protocols/SkypeWeb/src/skype_utils.cpp
@@ -515,4 +515,45 @@ char *CSkypeProto::ChatUrlToName(const char *url)
char *CSkypeProto::GetServerFromUrl(const char *url)
{
return ParseUrl(url, "://");
+}
+
+INT_PTR __cdecl CSkypeProto::ParseSkypeURI(WPARAM w, LPARAM lParam)
+{
+ TCHAR *arg = (TCHAR *)lParam;
+ if (arg == NULL)
+ return 1;
+
+ // skip leading prefix
+ TCHAR szUri[ 1024 ];
+ _tcsncpy_s(szUri, arg, _TRUNCATE);
+ TCHAR *szJid = _tcschr(szUri, _T(':'));
+ if (szJid == NULL)
+ return 1;
+
+ // skip //
+ for (++szJid; *szJid == _T('/'); ++szJid);
+
+ // empty jid?
+ if (!*szJid)
+ return 1;
+
+ // command code
+ TCHAR *szCommand = szJid;
+ szCommand = _tcschr(szCommand, _T('?'));
+ if (szCommand)
+ *(szCommand++) = 0;
+
+ // parameters
+ TCHAR *szSecondParam = szCommand ? _tcschr(szCommand, _T(';')) : NULL;
+ if (szSecondParam)
+ *(szSecondParam++) = 0;
+
+ // no command or message command
+ if (!szCommand || (szCommand && !_tcsicmp(szCommand, _T("chat"))))
+ {
+ //CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, NULL);
+ return 0;
+ }
+
+ return 1; /* parse failed */
} \ No newline at end of file