summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_accounts.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-02-28 06:48:33 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-02-28 06:48:33 +0000
commit21e7268a503be780b35e367564d711e79a61dffc (patch)
tree87b408e722116a6faea0d029d090e6278cda0f28 /protocols/Tox/src/tox_accounts.cpp
parent4410284da77786594d7009b6c515176de0d5a51e (diff)
Tox:
- added support of tox1 dns resolving - added request/grant items in contact menu - added copy id item in statum menu - code reordering - fixed minor bugs git-svn-id: http://svn.miranda-ng.org/main/trunk@12281 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_accounts.cpp')
-rw-r--r--protocols/Tox/src/tox_accounts.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/protocols/Tox/src/tox_accounts.cpp b/protocols/Tox/src/tox_accounts.cpp
index ce435043d7..618105dba7 100644
--- a/protocols/Tox/src/tox_accounts.cpp
+++ b/protocols/Tox/src/tox_accounts.cpp
@@ -1,6 +1,6 @@
#include "common.h"
-LIST<CToxProto> CToxProto::accounts(1, CToxProto::CompareAccounts);
+LIST<CToxProto> CToxProto::Accounts(1, CToxProto::CompareAccounts);
int CToxProto::CompareAccounts(const CToxProto *p1, const CToxProto *p2)
{
@@ -10,18 +10,29 @@ int CToxProto::CompareAccounts(const CToxProto *p1, const CToxProto *p2)
CToxProto* CToxProto::InitAccount(const char *protoName, const wchar_t *userName)
{
CToxProto *proto = new CToxProto(protoName, userName);
- accounts.insert(proto);
+ Accounts.insert(proto);
return proto;
}
int CToxProto::UninitAccount(CToxProto *proto)
{
- accounts.remove(proto);
+ Accounts.remove(proto);
delete proto;
-
return 0;
}
+CToxProto* CToxProto::GetContactAccount(MCONTACT hContact)
+{
+ for (int i = 0; i < Accounts.getCount(); i++)
+ {
+ if (mir_strcmpi(GetContactProto(hContact), Accounts[i]->m_szModuleName) == 0)
+ {
+ return Accounts[i];
+ }
+ }
+ return NULL;
+}
+
int CToxProto::OnAccountLoaded(WPARAM, LPARAM)
{
HookProtoEvent(ME_OPT_INITIALISE, &CToxProto::OnOptionsInit);