diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-05-31 12:00:47 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-05-31 12:00:47 +0000 |
commit | 6967fb68000cdf3431343ede41addcc5db2dfbae (patch) | |
tree | e20d0195adb6798a6ba11dc813731054270d9003 /protocols/Tox/src/tox_utils.cpp | |
parent | 1ce3da1cca093143d9629bc46e221dd8be962e12 (diff) |
Tox: added support of assocmgr
git-svn-id: http://svn.miranda-ng.org/main/trunk@13933 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_utils.cpp')
-rw-r--r-- | protocols/Tox/src/tox_utils.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_utils.cpp b/protocols/Tox/src/tox_utils.cpp index 2b22f02849..ed44c09630 100644 --- a/protocols/Tox/src/tox_utils.cpp +++ b/protocols/Tox/src/tox_utils.cpp @@ -75,4 +75,40 @@ MEVENT CToxProto::AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DW dbei.pBlob = pBlob;
dbei.flags = flags;
return db_event_add(hContact, &dbei);
+}
+
+INT_PTR CToxProto::ParseToxUri(WPARAM, LPARAM lParam)
+{
+ TCHAR *uri = (TCHAR*)lParam;
+ if (mir_tstrlen(uri) <= 4)
+ return 1;
+
+ if (Accounts.getCount() == 0)
+ return 1;
+
+ CToxProto *proto = NULL;
+ for (size_t i = 0; i < Accounts.getCount(); i++)
+ {
+ if (Accounts[i]->IsOnline())
+ {
+ proto = Accounts[i];
+ break;
+ }
+ }
+ if (proto == NULL)
+ return 1;
+
+ if (_tcschr(uri, _T('@')) != NULL)
+ return 1;
+
+ PROTOSEARCHRESULT psr = { sizeof(psr) };
+ psr.flags = PSR_TCHAR;
+ psr.id = mir_tstrdup(&uri[4]);
+
+ ADDCONTACTSTRUCT acs = { HANDLE_SEARCHRESULT };
+ acs.szProto = proto->m_szModuleName;
+ acs.psr = &psr;
+
+ CallService(MS_ADDCONTACT_SHOW, 0, (LPARAM)&acs);
+ return 0;
}
\ No newline at end of file |