summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/mc.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/mir_core/mc.cpp b/src/mir_core/mc.cpp
index ba9bbb7697..27a1626f67 100644
--- a/src/mir_core/mc.cpp
+++ b/src/mir_core/mc.cpp
@@ -153,11 +153,13 @@ MIR_CORE_DLL(int) db_mc_setDefault(MCONTACT hMetaContact, MCONTACT hSub, BOOL bW
if (contact_number == -1)
return 1;
- cc->nDefault = contact_number;
- if (bWriteDb)
- currDb->MetaSetDefault(cc);
-
- NotifyEventHooks(hEventDefaultChanged, hMetaContact, hSub);
+ if (cc->nDefault != contact_number) {
+ cc->nDefault = contact_number;
+ if (bWriteDb)
+ currDb->MetaSetDefault(cc);
+
+ NotifyEventHooks(hEventDefaultChanged, hMetaContact, hSub);
+ }
return 0;
}
@@ -170,11 +172,13 @@ MIR_CORE_DLL(int) db_mc_setDefaultNum(MCONTACT hMetaContact, int iNum, BOOL bWri
if (iNum >= cc->nSubs || iNum < 0)
return 1;
- cc->nDefault = iNum;
- if (bWriteDb)
- currDb->MetaSetDefault(cc);
+ if (cc->nDefault != iNum) {
+ cc->nDefault = iNum;
+ if (bWriteDb)
+ currDb->MetaSetDefault(cc);
- NotifyEventHooks(hEventDefaultChanged, hMetaContact, Meta_GetContactHandle(cc, iNum));
+ NotifyEventHooks(hEventDefaultChanged, hMetaContact, Meta_GetContactHandle(cc, iNum));
+ }
return 0;
}