From 8b242ddc84896c59f2a53cbfe37f94b275238a7c Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 4 Oct 2014 03:12:21 +0000 Subject: Tox: code reordering git-svn-id: http://svn.miranda-ng.org/main/trunk@10681 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Tox/src/tox_account.cpp | 11 ----------- protocols/Tox/src/tox_events.cpp | 2 +- protocols/Tox/src/tox_proto.cpp | 7 ++++--- protocols/Tox/src/tox_proto.h | 1 - 4 files changed, 5 insertions(+), 16 deletions(-) (limited to 'protocols') diff --git a/protocols/Tox/src/tox_account.cpp b/protocols/Tox/src/tox_account.cpp index 0262ba774e..97c659909b 100644 --- a/protocols/Tox/src/tox_account.cpp +++ b/protocols/Tox/src/tox_account.cpp @@ -13,9 +13,6 @@ int CToxProto::OnAccountLoaded(WPARAM, LPARAM) HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &CToxProto::OnSettingsChanged); HookProtoEvent(ME_MSG_PRECREATEEVENT, &CToxProto::OnPreCreateMessage); - InitNetlib(); - InitToxCore(); - return 0; } @@ -33,14 +30,6 @@ int CToxProto::OnAccountRenamed(WPARAM, LPARAM lParam) return 0; } -int CToxProto::OnAccountUnloaded(WPARAM, LPARAM) -{ - UninitToxCore(); - UninitNetlib(); - - return 0; -} - void CToxProto::InitToxCore() { std::tstring profilePath = GetToxProfilePath(); diff --git a/protocols/Tox/src/tox_events.cpp b/protocols/Tox/src/tox_events.cpp index d34ac4963a..5987557851 100644 --- a/protocols/Tox/src/tox_events.cpp +++ b/protocols/Tox/src/tox_events.cpp @@ -40,7 +40,7 @@ int CToxProto::OnSettingsChanged(WPARAM hContact, LPARAM lParam) { if (tox_set_name(tox, (uint8_t*)dbcws->value.pszVal, (uint16_t)strlen(dbcws->value.pszVal))) { - SaveToxProfile(); + //SaveToxProfile(); } } diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp index 485c049c33..ea60618fac 100644 --- a/protocols/Tox/src/tox_proto.cpp +++ b/protocols/Tox/src/tox_proto.cpp @@ -3,6 +3,8 @@ CToxProto::CToxProto(const char* protoName, const TCHAR* userName) : PROTO(protoName, userName) { + InitNetlib(); + InitToxCore(); accountName = mir_tstrdup(userName); CreateProtoService(PS_CREATEACCMGRUI, &CToxProto::OnAccountManagerInit); @@ -48,6 +50,8 @@ CToxProto::CToxProto(const char* protoName, const TCHAR* userName) : CToxProto::~CToxProto() { mir_free(accountName); + UninitToxCore(); + UninitNetlib(); } DWORD_PTR __cdecl CToxProto::GetCaps(int type, MCONTACT hContact) @@ -235,9 +239,6 @@ int __cdecl CToxProto::OnEvent(PROTOEVENTTYPE iEventType, WPARAM wParam, LPARAM case EV_PROTO_ONRENAME: return OnAccountRenamed(wParam, lParam); - case EV_PROTO_ONEXIT: - return OnAccountUnloaded(wParam, lParam); - case EV_PROTO_ONCONTACTDELETED: return OnContactDeleted(wParam, lParam); } diff --git a/protocols/Tox/src/tox_proto.h b/protocols/Tox/src/tox_proto.h index 405da468b5..c69ec385e6 100644 --- a/protocols/Tox/src/tox_proto.h +++ b/protocols/Tox/src/tox_proto.h @@ -145,7 +145,6 @@ private: bool IsOnline(); int __cdecl OnAccountLoaded(WPARAM, LPARAM); int __cdecl OnAccountRenamed(WPARAM, LPARAM); - int __cdecl OnAccountUnloaded(WPARAM, LPARAM); // events int __cdecl OnSettingsChanged(WPARAM wParam, LPARAM lParam); -- cgit v1.2.3