From 90a99f237d2332a5d882c0dcd3e2b4572b04944f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 13 Jul 2014 12:27:43 +0000 Subject: fixes #736 (Converting a contact into metacontact sometimes renames it) git-svn-id: http://svn.miranda-ng.org/main/trunk@9786 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/metacontacts/meta_options.cpp | 2 +- src/modules/metacontacts/meta_services.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/modules/metacontacts/meta_options.cpp b/src/modules/metacontacts/meta_options.cpp index 70738937b8..2dbcfd32c2 100644 --- a/src/modules/metacontacts/meta_options.cpp +++ b/src/modules/metacontacts/meta_options.cpp @@ -162,7 +162,7 @@ int Meta_ReadOptions(MetaOptions *opt) opt->bSuppressStatus = db_get_b(NULL, META_PROTO, "SuppressStatus", true) != 0; opt->menu_contact_label = (int)db_get_w(NULL, META_PROTO, "MenuContactLabel", DNT_UID); opt->menu_function = (int)db_get_w(NULL, META_PROTO, "MenuContactFunction", FT_MENU); - opt->clist_contact_name = (int)db_get_w(NULL, META_PROTO, "CListContactName", CNNT_NICK); + opt->clist_contact_name = (int)db_get_w(NULL, META_PROTO, "CListContactName", CNNT_DISPLAYNAME); opt->days_history = (int)db_get_dw(NULL, META_PROTO, "DaysHistory", 0); opt->set_status_from_offline_delay = (int)db_get_dw(NULL, META_PROTO, "SetStatusFromOfflineDelay", DEFAULT_SET_STATUS_SLEEP_TIME); opt->bLockHandle = db_get_b(NULL, META_PROTO, "LockHandle", false) != 0; diff --git a/src/modules/metacontacts/meta_services.cpp b/src/modules/metacontacts/meta_services.cpp index 5c28a2bf66..1e83790031 100644 --- a/src/modules/metacontacts/meta_services.cpp +++ b/src/modules/metacontacts/meta_services.cpp @@ -380,12 +380,11 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam) mir_snprintf(buffer, SIZEOF(buffer), "Nick%d", contact_number); db_set(ccMeta->contactID, META_PROTO, buffer, &dcws->value); - DBVARIANT dbv; - if (db_get_s(hContact, "CList", "MyHandle", &dbv, 0)) { + ptrT tszMyhandle(db_get_tsa(hContact, "CList", "MyHandle")); + if (tszMyhandle == NULL) { mir_snprintf(buffer, SIZEOF(buffer), "CListName%d", contact_number); db_set(ccMeta->contactID, META_PROTO, buffer, &dcws->value); } - else db_free(&dbv); // copy nick to metacontact, if it's the most online MCONTACT hMostOnline = Meta_GetMostOnline(ccMeta); -- cgit v1.2.3