diff options
author | George Hazan <george.hazan@gmail.com> | 2014-07-31 19:53:29 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-07-31 19:53:29 +0000 |
commit | 94b79e81e2d4677815aaab9155fe341090822f83 (patch) | |
tree | 799f9f11d9968b121950b3c6a1729d3ffd34c93b /src | |
parent | 4df1f9301740611b12beff24d14e5476a1622848 (diff) |
if sub setting doesn't change the active sub, no event should be fired
git-svn-id: http://svn.miranda-ng.org/main/trunk@10010 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_core/mc.cpp | 22 |
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;
}
|