diff options
author | George Hazan <george.hazan@gmail.com> | 2015-04-23 11:39:36 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-04-23 11:39:36 +0000 |
commit | 9393a87b150f75ae5bf018790a2cd5096600d90e (patch) | |
tree | aea2ee14e1c0498cb9f36f5220381ea40abfb1cf /src/modules/metacontacts/meta_menu.cpp | |
parent | dd13e3c81400c3607a4f63a501b53b46052035ab (diff) |
fix for the metacontact's editor
git-svn-id: http://svn.miranda-ng.org/main/trunk@13057 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/metacontacts/meta_menu.cpp')
-rw-r--r-- | src/modules/metacontacts/meta_menu.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/modules/metacontacts/meta_menu.cpp b/src/modules/metacontacts/meta_menu.cpp index af8a2177f6..3ecbf8481c 100644 --- a/src/modules/metacontacts/meta_menu.cpp +++ b/src/modules/metacontacts/meta_menu.cpp @@ -93,15 +93,14 @@ void Meta_RemoveContactNumber(DBCachedContact *ccMeta, int number, bool bUpdateI // make sure this contact thinks it's part of this metacontact
DBCachedContact *ccSub = currDb->m_cache->GetCachedContact(Meta_GetContactHandle(ccMeta, number));
- if (ccSub == NULL)
- return;
-
- if (ccSub->parentID == ccMeta->contactID) {
- db_unset(ccSub->contactID, "CList", "Hidden");
+ if (ccSub != NULL) {
+ if (ccSub->parentID == ccMeta->contactID) {
+ db_unset(ccSub->contactID, "CList", "Hidden");
- // stop ignoring, if we were
- if (options.bSuppressStatus)
- CallService(MS_IGNORE_UNIGNORE, ccSub->contactID, IGNOREEVENT_USERONLINE);
+ // stop ignoring, if we were
+ if (options.bSuppressStatus)
+ CallService(MS_IGNORE_UNIGNORE, ccSub->contactID, IGNOREEVENT_USERONLINE);
+ }
}
// each contact from 'number' upwards will be moved down one
@@ -133,10 +132,12 @@ void Meta_RemoveContactNumber(DBCachedContact *ccMeta, int number, bool bUpdateI mir_snprintf(buffer, SIZEOF(buffer), "CListName%d", id);
db_unset(ccMeta->contactID, META_PROTO, buffer);
- ccSub->parentID = 0;
- currDb->MetaDetouchSub(ccMeta, ccMeta->nSubs - 1);
+ if (ccSub != NULL) {
+ ccSub->parentID = 0;
+ currDb->MetaDetouchSub(ccMeta, ccMeta->nSubs - 1);
- currDb->MetaSplitHistory(ccMeta, ccSub);
+ currDb->MetaSplitHistory(ccMeta, ccSub);
+ }
// if the default contact was equal to or greater than 'number', decrement it (and deal with ends)
if (ccMeta->nDefault >= number) {
@@ -183,7 +184,7 @@ INT_PTR Meta_Delete(WPARAM hContact, LPARAM bSkipQuestion) {
DBCachedContact *cc = currDb->m_cache->GetCachedContact(hContact);
if (cc == NULL)
- return 0;
+ return 1;
// The wParam is a metacontact
if (cc->IsMeta()) {
@@ -202,7 +203,7 @@ INT_PTR Meta_Delete(WPARAM hContact, LPARAM bSkipQuestion) }
else if (cc->IsSub()) {
if ((cc = currDb->m_cache->GetCachedContact(cc->parentID)) == NULL)
- return 0;
+ return 2;
if (cc->nSubs == 1) {
if (IDYES == MessageBox(0, TranslateT(szDelMsg), TranslateT("Delete metacontact?"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON1))
|