From 88c3082ba9a98453111cc249994e6dd9656a661e Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Fri, 1 May 2015 11:42:56 +0000 Subject: SkypeWeb: 'skype:' uri full support. git-svn-id: http://svn.miranda-ng.org/main/trunk@13331 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_contacts.cpp | 2 +- protocols/SkypeWeb/src/skype_utils.cpp | 47 +++++++++++++++++++++++++++---- protocols/SkypeWeb/src/stdafx.h | 1 + 3 files changed, 44 insertions(+), 6 deletions(-) (limited to 'protocols/SkypeWeb/src') diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index a7ee562812..0e00c5753b 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -63,7 +63,7 @@ MCONTACT CSkypeProto::FindContact(const char *skypename) for (hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { ptrA cSkypename(getStringA(hContact, SKYPE_SETTINGS_ID)); - if (mir_strcmpi(skypename, cSkypename) == 0) + if (!mir_strcmpi(skypename, cSkypename)) break; } return hContact; diff --git a/protocols/SkypeWeb/src/skype_utils.cpp b/protocols/SkypeWeb/src/skype_utils.cpp index cf0219663b..097e9345af 100644 --- a/protocols/SkypeWeb/src/skype_utils.cpp +++ b/protocols/SkypeWeb/src/skype_utils.cpp @@ -566,24 +566,61 @@ INT_PTR CSkypeProto::ParseSkypeUriService(WPARAM, LPARAM lParam) *(szCommand++) = 0; // parameters - TCHAR *szSecondParam = szCommand ? _tcschr(szCommand, _T(';')) : NULL; + TCHAR *szSecondParam = szCommand ? _tcschr(szCommand, _T('&')) : NULL; if (szSecondParam) *(szSecondParam++) = 0; - MCONTACT hContact = AddContact(_T2A(szJid), true); // no command or message command if (!szCommand || (szCommand && !_tcsicmp(szCommand, _T("chat")))) { + if (szSecondParam) + { + TCHAR *szChatId = _tcsstr(szSecondParam, _T("id=")); + if (szChatId) + { + szChatId += 5; + StartChatRoom(szChatId, szChatId); + return 0; + } + } + MCONTACT hContact = AddContact(_T2A(szJid), true); CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, NULL); return 0; } - else if (szCommand && !_tcsicmp(szCommand, _T("call"))) + else if (!_tcsicmp(szCommand, _T("call"))) { + MCONTACT hContact = AddContact(_T2A(szJid), true); NotifyEventHooks(m_hCallHook, (WPARAM)hContact, (LPARAM)0); return 0; } - else if (szCommand && !_tcsicmp(szCommand, _T("userinfo"))){ return 0;} - + else if (!_tcsicmp(szCommand, _T("userinfo"))){ return 0;} + else if (!_tcsicmp(szCommand, _T("add"))) + { + MCONTACT hContact = FindContact(_T2A(szJid)); + if (hContact == NULL) + { + PROTOSEARCHRESULT psr = { 0 }; + psr.id = mir_tstrdup(szJid); + psr.nick = mir_tstrdup(szJid); + psr.flags = PSR_TCHAR; + + ADDCONTACTSTRUCT acs; + acs.handleType = HANDLE_SEARCHRESULT; + acs.szProto = m_szModuleName; + acs.psr = &psr; + CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs); + } + return 0; + } + if (!_tcsicmp(szCommand, _T("sendfile"))) + { + MCONTACT hContact = AddContact(_T2A(szJid), true); + CallService(MS_FILE_SENDFILE, hContact, NULL); + } + if (!_tcsicmp(szCommand, _T("voicemail"))) + { + return 1; + } return 1; /* parse failed */ } diff --git a/protocols/SkypeWeb/src/stdafx.h b/protocols/SkypeWeb/src/stdafx.h index 6306328ee8..fbe0b7ff5e 100644 --- a/protocols/SkypeWeb/src/stdafx.h +++ b/protocols/SkypeWeb/src/stdafx.h @@ -57,6 +57,7 @@ along with this program. If not, see . #include #include #include +#include struct CSkypeProto; -- cgit v1.2.3