diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-08-21 20:25:28 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-08-21 20:25:28 +0000 |
commit | 3c9026fef3ebe0e80855b51351b5c1bad05d9f0d (patch) | |
tree | 2cd27952146fff32c2e43f1ebd57c790c355dcbd /protocols/Tox/src/tox_events.cpp | |
parent | 518a4b2226ca1904a39dca7a77a5afaa8984c011 (diff) |
Tox:
- fixed own nick changing
- reworked search/add dialog
git-svn-id: http://svn.miranda-ng.org/main/trunk@10268 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_events.cpp')
-rw-r--r-- | protocols/Tox/src/tox_events.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/protocols/Tox/src/tox_events.cpp b/protocols/Tox/src/tox_events.cpp index 3857267c88..374b2d3ef8 100644 --- a/protocols/Tox/src/tox_events.cpp +++ b/protocols/Tox/src/tox_events.cpp @@ -4,6 +4,7 @@ int CToxProto::OnAccountLoaded(WPARAM, LPARAM) {
HookEventObj(ME_OPT_INITIALISE, OnOptionsInit, this);
HookEventObj(ME_PROTO_ACCLISTCHANGED, OnAccountListChanged, this);
+ HookEventObj(ME_DB_CONTACT_SETTINGCHANGED, OnSettingsChanged, this);
InitNetlib();
@@ -89,26 +90,28 @@ int CToxProto::OnContactDeleted(MCONTACT hContact, LPARAM lParam) return 1;
}
-int CToxProto::OnSettingsChanged(MCONTACT hContact, LPARAM lParam)
+int CToxProto::OnSettingsChanged(void *obj, WPARAM hContact, LPARAM lParam)
{
+ CToxProto *proto = (CToxProto*)obj;
+
DBCONTACTWRITESETTING* dbcws = (DBCONTACTWRITESETTING*)lParam;
- if (hContact == NULL && !strcmp(dbcws->szModule, m_szModuleName))
+ if (hContact == NULL && !strcmp(dbcws->szModule, proto->m_szModuleName))
{
- if (!strcmp(dbcws->szSetting, "Nick"))
+ if (!strcmp(dbcws->szSetting, "Nick") && dbcws->value.pszVal)
{
- if (tox_set_name(tox, (uint8_t*)(char*)ptrA(mir_utf8encodeW(dbcws->value.ptszVal)), (uint16_t)_tcslen(dbcws->value.ptszVal)))
+ if (tox_set_name(proto->tox, (uint8_t*)dbcws->value.pszVal, (uint16_t)strlen(dbcws->value.pszVal)))
{
- SaveToxData();
+ proto->SaveToxData();
}
}
- if (!strcmp(dbcws->szSetting, "StatusMsg") || !strcmp(dbcws->szSetting, "StatusNote"))
+ /*if (!strcmp(dbcws->szSetting, "StatusMsg") || !strcmp(dbcws->szSetting, "StatusNote"))
{
if (tox_set_status_message(tox, (uint8_t*)(char*)ptrA(mir_utf8encodeW(dbcws->value.ptszVal)), (uint16_t)_tcslen(dbcws->value.ptszVal)))
{
SaveToxData();
}
- }
+ }*/
}
return 0;
|