summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-03-09 18:03:06 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-03-09 18:03:06 +0000
commit4613ce7f80f2a5d7cebad04bfcdbf01f26980679 (patch)
treedb1249976a048e6bb854867c8d88dd29fe3c3149 /src
parent535b7733c38c9e4c75a8ff73f231c8b807194124 (diff)
more correct default sub assignment
git-svn-id: http://svn.miranda-ng.org/main/trunk@8515 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/modules/metacontacts/meta_menu.cpp39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/modules/metacontacts/meta_menu.cpp b/src/modules/metacontacts/meta_menu.cpp
index b14e5b0c08..cd71119ba5 100644
--- a/src/modules/metacontacts/meta_menu.cpp
+++ b/src/modules/metacontacts/meta_menu.cpp
@@ -52,32 +52,33 @@ INT_PTR Meta_Convert(WPARAM wParam, LPARAM lParam)
// Create a new metacontact
MCONTACT hMetaContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
- if (hMetaContact) {
- DBCachedContact *cc = currDb->m_cache->GetCachedContact(hMetaContact);
- if (cc == NULL)
- return 0;
+ if (hMetaContact == NULL)
+ return NULL;
- db_set_dw(hMetaContact, META_PROTO, "NumContacts", 0);
- cc->nSubs = 0;
+ DBCachedContact *cc = currDb->m_cache->GetCachedContact(hMetaContact);
+ if (cc == NULL)
+ return 0;
- // Add the MetaContact protocol to the new meta contact
- CallService(MS_PROTO_ADDTOCONTACT, hMetaContact, (LPARAM)META_PROTO);
+ db_set_dw(hMetaContact, META_PROTO, "NumContacts", 0);
+ cc->nSubs = 0;
- if (tszGroup)
- db_set_ts(hMetaContact, "CList", "Group", tszGroup);
+ // Add the MetaContact protocol to the new meta contact
+ CallService(MS_PROTO_ADDTOCONTACT, hMetaContact, (LPARAM)META_PROTO);
- // Assign the contact to the MetaContact just created (and make default).
- if (!Meta_Assign(wParam, hMetaContact, TRUE)) {
- MessageBox(0, TranslateT("There was a problem in assigning the contact to the MetaContact"), TranslateT("Error"), MB_ICONEXCLAMATION);
- CallService(MS_DB_CONTACT_DELETE, hMetaContact, 0);
- return 0;
- }
+ if (tszGroup)
+ db_set_ts(hMetaContact, "CList", "Group", tszGroup);
- // hide the contact if clist groups disabled (shouldn't create one anyway since menus disabled)
- if (!options.bEnabled)
- db_set_b(hMetaContact, "CList", "Hidden", 1);
+ // Assign the contact to the MetaContact just created (and make default).
+ if (!Meta_Assign(wParam, hMetaContact, TRUE)) {
+ MessageBox(0, TranslateT("There was a problem in assigning the contact to the MetaContact"), TranslateT("Error"), MB_ICONEXCLAMATION);
+ CallService(MS_DB_CONTACT_DELETE, hMetaContact, 0);
+ return 0;
}
+ // hide the contact if clist groups disabled (shouldn't create one anyway since menus disabled)
+ if (!options.bEnabled)
+ db_set_b(hMetaContact, "CList", "Hidden", 1);
+
return hMetaContact;
}