summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_utils.cpp
diff options
context:
space:
mode:
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