From 0749bac971a90ae89d095d2ef81a27f4988f72f0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 2 Mar 2014 22:00:19 +0000 Subject: compilation fix git-svn-id: http://svn.miranda-ng.org/main/trunk@8365 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/metacontacts/meta_services.cpp | 31 +------- src/modules/metacontacts/meta_utils.cpp | 113 +---------------------------- src/modules/metacontacts/metacontacts.h | 2 - 3 files changed, 3 insertions(+), 143 deletions(-) diff --git a/src/modules/metacontacts/meta_services.cpp b/src/modules/metacontacts/meta_services.cpp index 9759576460..2ce161b191 100644 --- a/src/modules/metacontacts/meta_services.cpp +++ b/src/modules/metacontacts/meta_services.cpp @@ -578,19 +578,7 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) contact_number = Meta_GetContactNumber(wParam); if (contact_number == -1) return 0; // exit - db corruption - if (!meta_group_hack_disabled && !strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "Group") && - Meta_IsEnabled() && db_get_b(wParam, META_PROTO, "Hidden", 0) == 0 && !Miranda_Terminated()) { - if ((dcws->value.type == DBVT_ASCIIZ || dcws->value.type == DBVT_UTF8) && !Meta_IsHiddenGroup(dcws->value.pszVal)) { - // subcontact group reassigned - copy to saved group - db_set(wParam, META_PROTO, "OldCListGroup", &dcws->value); - db_set_s(wParam, "CList", "Group", META_HIDDEN_GROUP); - } - else if (dcws->value.type == DBVT_DELETED) { - db_unset(wParam, META_PROTO, "OldCListGroup"); - db_set_s(wParam, "CList", "Group", META_HIDDEN_GROUP); - } - } - else if (!strcmp(dcws->szSetting, "IP")) { + if (!strcmp(dcws->szSetting, "IP")) { if (dcws->value.type == DBVT_DWORD) db_set_dw(hMeta, META_PROTO, "IP", dcws->value.dVal); else @@ -718,16 +706,8 @@ int Meta_SettingChanged(WPARAM wParam, LPARAM lParam) else if (strcmp(dcws->szSetting, "XStatusId") == 0 || strcmp(dcws->szSetting, "XStatusMsg") == 0 || strcmp(dcws->szSetting, "XStatusName") == 0 || strcmp(dcws->szSetting, "StatusMsg") == 0) { Meta_CopyData(hMeta); } - else if (strcmp(dcws->szSetting, "MirVer") == 0) { + else if (strcmp(dcws->szSetting, "MirVer") == 0) Meta_CopyData(hMeta); - } - else if (!meta_group_hack_disabled && !strcmp(dcws->szModule, "CList") && !strcmp(dcws->szSetting, "Hidden")) { - if ((dcws->value.type == DBVT_DELETED || db_get_b(wParam, "CList", "Hidden", 0) == 0) - && db_get_b(wParam, META_PROTO, "Hidden", 0) == 1) { - // a subcontact we hid (e.g. jabber) has been unhidden - hide it again :( - db_set_b(wParam, "CList", "Hidden", 1); - } - } } return 0; @@ -908,13 +888,6 @@ int NudgeRecieved(WPARAM wParam, LPARAM lParam) */ int Meta_ModulesLoaded(WPARAM wParam, LPARAM lParam) { - // disable group hack for older nicer versions without the fix - if (ServiceExists(MS_CLUI_GETVERSION)) { - char *version = (char *)CallService(MS_CLUI_GETVERSION, 0, 0); - if (version && strlen(version) >= strlen("CList Nicer+") && strncmp(version, "CList Nicer+", strlen("CList Nicer+")) == 0) - meta_group_hack_disabled = TRUE; - } - HookEvent(ME_CLIST_PREBUILDCONTACTMENU, Meta_ModifyMenu); HookEvent(ME_CLIST_DOUBLECLICKED, Meta_ClistDoubleClicked); diff --git a/src/modules/metacontacts/meta_utils.cpp b/src/modules/metacontacts/meta_utils.cpp index 54e52083af..87a4f5279d 100644 --- a/src/modules/metacontacts/meta_utils.cpp +++ b/src/modules/metacontacts/meta_utils.cpp @@ -697,23 +697,6 @@ int Meta_HideLinkedContacts(void) DWORD meta_id, num_contacts, contact_number; char buffer[512], buffer2[512]; - // ensure the hidden group does not exist (how this occurs i wonder but there have been reports!) - // (sometimes protocol server side groups are to blame - msn and icq) - if (!meta_group_hack_disabled) { - for (int hGroup=1;; hGroup++) { - char *group_name = (char*)CallService(MS_CLIST_GROUPGETNAME, hGroup, 0); - if (group_name == NULL) - break; - - if (!strcmp(group_name, META_HIDDEN_GROUP)) { - // disabled because it shows a message box - //CallService(MS_CLIST_GROUPDELETE, (WPARAM)hGroup, 0); - MessageBox(0, TranslateT(szMsg), TranslateT("MetaContacts Warning"), MB_ICONWARNING | MB_OK); - break; - } - } - } - for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) { if ((meta_id = db_get_dw(hContact, META_PROTO, META_LINK, INVALID_CONTACT_ID)) != INVALID_CONTACT_ID) { // get contact number @@ -831,104 +814,10 @@ int Meta_HideMetaContacts(int hide) void Meta_RestoreGroup(MCONTACT hContact) { - if (meta_group_hack_disabled) return; // clist has called api function to disable group hack - yay! - - // the existence of this service means that clist_meta_mw is active and will do the hiding for us - if (ServiceExists(MS_CLUI_METASUPPORT)) return; - - // show it anyway - users are reporting contacts removed from meta remain 'hidden' - // possible suspect - server side groups cause hidden group hack to fail, users hide contacts via clist->delete->hide option - db_unset(hContact, META_PROTO, "Hidden"); - - if (db_get_b(hContact, META_PROTO, "Hidden", 0) == 1) { - // if we hid it, unhide it - db_unset(hContact, META_PROTO, "Hidden"); - db_unset(hContact, "CList", "Hidden"); - } - else { - DBCONTACTWRITESETTING cws; - - if (!db_get(hContact, META_PROTO, "OldCListGroup", &cws.value)) { - - if ((cws.value.type == DBVT_ASCIIZ || cws.value.type == DBVT_UTF8) && !strcmp(cws.value.pszVal, META_HIDDEN_GROUP)) { - db_unset(hContact, "CList", "Group"); - } - else { - int hGroup = 1; - char *name = 0; - BOOL found = FALSE; - do { - name = (char *)CallService(MS_CLIST_GROUPGETNAME, (WPARAM)hGroup, 0); - if (name && !strcmp(name, cws.value.pszVal)) { - found = TRUE; - break; - } - hGroup++; - } while (name); - - if (found) - db_set(hContact, "CList", "Group", &cws.value); - else { - // put back into metacontact's group - DBVARIANT dbv; - MCONTACT hMeta = (MCONTACT)db_get_dw(hContact, META_PROTO, "Handle", 0); - if (hMeta && !Mydb_get(hMeta, "CList", "Group", &dbv)) { - db_set(hContact, "CList", "Group", &dbv); - db_free(&dbv); - } - else db_unset(hContact, "CList", "Group"); - } - } - db_free(&cws.value); - } - db_unset(hContact, META_PROTO, "OldCListGroup"); - - if (!db_get(hContact, "CList", "Group", &cws.value)) { - if ((cws.value.type == DBVT_ASCIIZ || cws.value.type == DBVT_UTF8) && !strcmp(cws.value.pszVal, META_HIDDEN_GROUP)) { - db_unset(hContact, "CList", "Group"); - } - db_free(&cws.value); - } - } - - // show it anyway - users are reporting contacts removed from meta remain 'hidden' - // possible suspect - server side groups cause hidden group hack to fail, users hide contacts via clist->delete->hide option - db_unset(hContact, "CList", "Hidden"); } void Meta_SetGroup(MCONTACT hContact) { - char *szProto, *uid; - - if (meta_group_hack_disabled) return; // clist has called api function to disable group hack - yay! - - // the existence of this service means that clist_meta_mw is active and will do the hiding for us - if (ServiceExists(MS_CLUI_METASUPPORT)) return; - - szProto = GetContactProto(hContact); - if (szProto) - uid = (char *)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0); - - if (szProto && uid && (INT_PTR)uid != CALLSERVICE_NOTFOUND && !strcmp(JABBER_UNIQUE_ID_SETTING, uid)) { - // if it's a jabber contact, hide it, and record the fact that it was us who did - db_set_b(hContact, META_PROTO, "Hidden", 1); - db_set_b(hContact, "CList", "Hidden", 1); - } - else { - DBVARIANT dbv; - // save old group and move to invisible group (i.e. non-existent group) - if (!Mydb_get(hContact, "CList", "Group", &dbv)) { - if ((dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_UTF8) && !strcmp(dbv.pszVal, META_HIDDEN_GROUP)) - ; // it's already in the group (shouldn't be - but maybe a crash) - else - db_set(hContact, META_PROTO, "OldCListGroup", &dbv); - - db_free(&dbv); - } - else db_unset(hContact, META_PROTO, "OldCListGroup"); - - db_set_s(hContact, "CList", "Group", META_HIDDEN_GROUP); - } } int Meta_SuppressStatus(BOOL suppress) @@ -1175,5 +1064,5 @@ void Meta_FixStatus(MCONTACT hMeta) INT_PTR Meta_IsEnabled() { - return db_get_b(0, META_PROTO, "Enabled", 1) && (meta_group_hack_disabled || db_get_b(NULL, "CList", "UseGroups", 1)); + return db_get_b(0, META_PROTO, "Enabled", 1); } diff --git a/src/modules/metacontacts/metacontacts.h b/src/modules/metacontacts/metacontacts.h index e2fce9fdee..a4d876aa35 100644 --- a/src/modules/metacontacts/metacontacts.h +++ b/src/modules/metacontacts/metacontacts.h @@ -169,8 +169,6 @@ extern char proto_names[MAX_PROTOCOLS * 128]; // service from clist_meta_mw, existence means we don't need to hide subcontacts (woohoo - thanks FYR) #define MS_CLUI_METASUPPORT "CLUI/MetaContactSupport" -extern BOOL meta_group_hack_disabled; - #ifndef MS_CLUI_GETVERSION #define MS_CLUI_GETVERSION "CLUI/GetVersion" -- cgit v1.2.3