diff options
author | George Hazan <george.hazan@gmail.com> | 2014-03-09 15:58:00 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-03-09 15:58:00 +0000 |
commit | b9a874d255a4c32297b3081d7bd94407595b2cab (patch) | |
tree | 5728a7a888f33d47cbd05e93b6bef1ff48985bdd /plugins | |
parent | 01c9623d150e101e9e7f803f632e856b21be48ff (diff) |
any received event to select the default sub
git-svn-id: http://svn.miranda-ng.org/main/trunk@8508 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Db3x_mmap/src/dbevents.cpp | 18 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 2 |
2 files changed, 17 insertions, 3 deletions
diff --git a/plugins/Db3x_mmap/src/dbevents.cpp b/plugins/Db3x_mmap/src/dbevents.cpp index 7be9a20906..704e91f78e 100644 --- a/plugins/Db3x_mmap/src/dbevents.cpp +++ b/plugins/Db3x_mmap/src/dbevents.cpp @@ -25,6 +25,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static HANDLE hEventDeletedEvent, hEventAddedEvent, hEventFilterAddedEvent;
+static int IndexOf(DBCachedContact *cc, MCONTACT hSub)
+{
+ for (int i = 0; i < cc->nSubs; i++)
+ if (cc->pSubs[i] == hSub)
+ return i;
+
+ return -1;
+}
+
STDMETHODIMP_(LONG) CDb3Mmap::GetEventCount(MCONTACT contactID)
{
mir_cslock lck(m_csDbAccess);
@@ -51,8 +60,13 @@ STDMETHODIMP_(HANDLE) CDb3Mmap::AddEvent(MCONTACT contactID, DBEVENTINFO *dbei) if (cc == NULL)
return NULL;
- if (cc->IsSub())
- contactID = cc->parentID;
+ if (cc->IsSub()) {
+ if (cc = m_cache->GetCachedContact(cc->parentID)) {
+ // set default sub to the event's source
+ cc->nDefault = IndexOf(cc, contactID);
+ contactID = cc->contactID; // and add an event to a metahistory
+ }
+ }
}
if (NotifyEventHooks(hEventFilterAddedEvent, contactID, (LPARAM)dbei))
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 7df0424184..064a069700 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -3071,7 +3071,7 @@ quote_from_last: {
DWORD idFrom = GetDlgCtrlID((HWND)wParam);
if (idFrom >= MIN_CBUTTONID && idFrom <= MAX_CBUTTONID) {
- BB_CustomButtonClick(dat,idFrom,(HWND) wParam,1);
+ BB_CustomButtonClick(dat, idFrom, (HWND)wParam, 1);
break;
}
|