summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_accounts.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-08-30 11:37:47 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-08-30 11:37:47 +0000
commitce49c84f3a26f016f9232d2bffdc830d7fd6169f (patch)
treec6bbdab7b5a42f65461a5d495d962c4ff69b9e97 /protocols/Tox/src/tox_accounts.cpp
parentbeaf93e92827b7bcc77c9f6b2a0c7097d355151c (diff)
Tox:
- switch to offline when connection is lost - file transfer support - code refactoring - project reordering - version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@10340 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_accounts.cpp')
-rw-r--r--protocols/Tox/src/tox_accounts.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_accounts.cpp b/protocols/Tox/src/tox_accounts.cpp
new file mode 100644
index 0000000000..147c328656
--- /dev/null
+++ b/protocols/Tox/src/tox_accounts.cpp
@@ -0,0 +1,43 @@
+#include "common.h"
+
+LIST<CToxProto> CToxProto::accounts(1, CToxProto::CompareAccounts);
+
+int CToxProto::CompareAccounts(const CToxProto *p1, const CToxProto *p2)
+{
+ return _tcscmp(p1->m_tszUserName, p2->m_tszUserName);
+}
+
+CToxProto* CToxProto::InitAccount(const char* protoName, const wchar_t* userName)
+{
+ CToxProto *ppro = new CToxProto(protoName, userName);
+ accounts.insert(ppro);
+
+ return ppro;
+}
+
+int CToxProto::UninitAccount(CToxProto* ppro)
+{
+ accounts.remove(ppro);
+ delete ppro;
+
+ return 0;
+}
+
+int CToxProto::OnAccountListChanged(WPARAM wParam, LPARAM lParam)
+{
+ PROTOACCOUNT* account = (PROTOACCOUNT*)lParam;
+
+ if (wParam == PRAC_ADDED && !strcmp(account->szModuleName, m_szModuleName))
+ {
+ UninitToxCore();
+ DialogBoxParam(
+ g_hInstance,
+ MAKEINTRESOURCE(IDD_PROFILE_MANAGER),
+ account->hwndAccMgrUI,
+ CToxProto::ToxProfileManagerProc,
+ (LPARAM)this);
+ InitToxCore();
+ }
+
+ return 0;
+} \ No newline at end of file