diff options
author | George Hazan <george.hazan@gmail.com> | 2014-06-13 17:07:33 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-06-13 17:07:33 +0000 |
commit | f41c498aebfdfe3dfcabbda50363ea9278fe586b (patch) | |
tree | eb04995163bfb725849efc13b3407086d1427b96 /plugins | |
parent | 8b8368ee572b937ae5672e76af0544067a59421a (diff) |
tabSRMM to open subs as subs, metas as metas
git-svn-id: http://svn.miranda-ng.org/main/trunk@9462 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/TabSRMM/src/generic_msghandlers.cpp | 12 | ||||
-rw-r--r-- | plugins/TabSRMM/src/mim.cpp | 9 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdialog.cpp | 17 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 14 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.h | 4 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.cpp | 3 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgs.h | 1 | ||||
-rw-r--r-- | plugins/TabSRMM/src/sendqueue.cpp | 6 | ||||
-rw-r--r-- | plugins/TabSRMM/src/version.h | 4 |
9 files changed, 33 insertions, 37 deletions
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 8e664f85a0..f0fb3246ed 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -1611,10 +1611,8 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM wParam, LPARAM lParam) if (dat->hDbEventFirst == NULL) dat->hDbEventFirst = hDbEvent; - BOOL bIsStatusChangeEvent = IsStatusEvent(dbei.eventType); - - if (dbei.eventType == EVENTTYPE_MESSAGE && (dbei.flags & DBEF_READ)) - return; + bool bIsStatusChangeEvent = IsStatusEvent(dbei.eventType); + bool bDisableNotify = (dbei.eventType == EVENTTYPE_MESSAGE && (dbei.flags & DBEF_READ)); if (!DbEventIsShown(dat, &dbei)) return; @@ -1648,7 +1646,8 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM wParam, LPARAM lParam) SendMessage(hwndDlg, DM_ADDDIVIDER, 0, 0); } } - tabSRMM_ShowPopup(wParam, hDbEvent, dbei.eventType, m_pContainer->fHidden ? 0 : 1, m_pContainer, hwndDlg, dat->cache->getActiveProto(), dat); + if (!bDisableNotify) + tabSRMM_ShowPopup(wParam, hDbEvent, dbei.eventType, m_pContainer->fHidden ? 0 : 1, m_pContainer, hwndDlg, dat->cache->getActiveProto(), dat); if (IsWindowVisible(m_pContainer->hwnd)) m_pContainer->fHidden = false; } @@ -1696,7 +1695,8 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM wParam, LPARAM lParam) /* * try to flash the contact list... */ - FlashOnClist(hwndDlg, dat, hDbEvent, &dbei); + if (!bDisableNotify) + FlashOnClist(hwndDlg, dat, hDbEvent, &dbei); /* * autoswitch tab if option is set AND container is minimized (otherwise, we never autoswitch) diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index 3df8f93aaa..21e412c172 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -493,13 +493,8 @@ int CMimAPI::PrebuildContactMenu(WPARAM hContact, LPARAM lParam) int CMimAPI::DispatchNewEvent(WPARAM hContact, LPARAM lParam) { - if (hContact) { - HWND h = M.FindWindow(hContact); - if (h == NULL) - h = M.FindWindow(hContact = db_event_getContact((HANDLE)lParam)); - if (h) - PostMessage(h, HM_DBEVENTADDED, hContact, lParam); // was SENDMESSAGE !!! XXX - } + if (hContact) + M.BroadcastMessageAsync(HM_DBEVENTADDED, hContact, lParam); return 0; } diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 3de6b4a4cd..1d92b1aacb 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -2421,6 +2421,15 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP StreamInEvents(hwndDlg, dat->hDbEventFirst, -1, 0, NULL);
return 0;
+ case DM_APPENDMCEVENT:
+ if (dat->hContact == db_mc_getMeta(wParam) && dat->hDbEventFirst == NULL) {
+ dat->hDbEventFirst = (HANDLE)lParam;
+ SendMessage(dat->hwnd, DM_REMAKELOG, 0, 0);
+ }
+ else if (dat->hContact == wParam && db_mc_isSub(wParam) && db_event_getContact(HANDLE(lParam)) != wParam)
+ StreamInEvents(hwndDlg, (HANDLE)lParam, 1, 1, NULL);
+ return 0;
+
case DM_APPENDTOLOG:
StreamInEvents(hwndDlg, (HANDLE)wParam, 1, 1, NULL);
return 0;
@@ -2487,11 +2496,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP case HM_DBEVENTADDED:
if (!dat)
return 0;
- if (wParam != dat->hContact)
- return 0;
- if (dat->hContact == NULL)
- return 0;
- DM_EventAdded(dat, wParam, lParam);
+ if (dat->hContact)
+ if (wParam == dat->hContact || wParam == db_mc_getMeta(dat->hContact))
+ DM_EventAdded(dat, dat->hContact, lParam);
return 0;
case WM_TIMER:
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 24005d3032..b26a8f977a 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -51,25 +51,25 @@ static int g_status_events[] = { static int g_status_events_size = 0;
#define MAX_REGS(_A_) ( sizeof(_A_) / sizeof(_A_[0]))
-BOOL TSAPI IsStatusEvent(int eventType)
+bool TSAPI IsStatusEvent(int eventType)
{
if (g_status_events_size == 0)
g_status_events_size = MAX_REGS(g_status_events);
for (int i=0; i < g_status_events_size; i++) {
if (eventType == g_status_events[i])
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
-BOOL TSAPI IsCustomEvent(int eventType)
+bool TSAPI IsCustomEvent(int eventType)
{
if (eventType == EVENTTYPE_MESSAGE || eventType == EVENTTYPE_URL || eventType == EVENTTYPE_CONTACTS ||
- eventType == EVENTTYPE_ADDED || eventType == EVENTTYPE_AUTHREQUEST || eventType == EVENTTYPE_FILE)
- return FALSE;
+ eventType == EVENTTYPE_ADDED || eventType == EVENTTYPE_AUTHREQUEST || eventType == EVENTTYPE_FILE)
+ return false;
- return TRUE;
+ return true;
}
// reorder tabs within a container. fSavePos indicates whether the new position should be saved to the
diff --git a/plugins/TabSRMM/src/msgdlgutils.h b/plugins/TabSRMM/src/msgdlgutils.h index 54ceba788b..c285b46462 100644 --- a/plugins/TabSRMM/src/msgdlgutils.h +++ b/plugins/TabSRMM/src/msgdlgutils.h @@ -76,8 +76,8 @@ void TSAPI FlashTab (TWindowData *dat, HWND hwndTab, int iTabindex, BOOL *b void TSAPI GetClientIcon (TWindowData *dat);
void TSAPI RearrangeTab (HWND hwndDlg, const TWindowData *dat, int iMode, BOOL fSavePos);
void TSAPI GetCachedStatusMsg (TWindowData *dat);
-BOOL TSAPI IsStatusEvent (int eventType);
-BOOL TSAPI IsCustomEvent (int eventType);
+bool TSAPI IsStatusEvent(int eventType);
+bool TSAPI IsCustomEvent(int eventType);
void TSAPI GetMyNick (TWindowData *dat);
HICON TSAPI MY_GetContactIcon (const TWindowData *dat);
void TSAPI CheckAndDestroyIEView (TWindowData *dat);
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index b653c1d432..460eef7111 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -281,9 +281,6 @@ INT_PTR SendMessageCommand_Worker(MCONTACT hContact, LPCSTR pszMsg, bool isWchar return 0;
}
- if (db_mc_isSub(hContact))
- hContact = db_mc_getMeta(hContact);
-
// does the MCONTACT's protocol support IM messages?
char *szProto = GetContactProto(hContact);
if (szProto == NULL)
diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index f9e60b9fac..b72f5cd47d 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -527,6 +527,7 @@ struct TNewWindowData #define DM_QUERYCONTAINER (TM_USER+31)
#define DM_MUCFLASHWORKER (TM_USER+32)
#define DM_INVALIDATEPANEL (TM_USER+33)
+#define DM_APPENDMCEVENT (TM_USER+34)
#define DM_CHECKINFOTIP (TM_USER+35)
#define DM_SAVESIZE (TM_USER+36)
#define DM_CHECKSIZE (TM_USER+37)
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index 7a5a5a559c..a5d147570d 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -741,11 +741,7 @@ inform_and_discard: if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND))
SkinPlaySound("SendMsg");
- if (dat && job.hContact == dat->hContact)
- if (dat->hDbEventFirst == NULL) {
- dat->hDbEventFirst = hNewEvent;
- SendMessage(dat->hwnd, DM_REMAKELOG, 0, 0);
- }
+ M.BroadcastMessage(DM_APPENDMCEVENT, job.hContact, LPARAM(hNewEvent));
job.hSendId = NULL;
job.iAcksNeeded--;
diff --git a/plugins/TabSRMM/src/version.h b/plugins/TabSRMM/src/version.h index 3cb9b306f1..ac37b2c636 100644 --- a/plugins/TabSRMM/src/version.h +++ b/plugins/TabSRMM/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 3
#define __MINOR_VERSION 3
-#define __RELEASE_NUM 0
-#define __BUILD_NUM 3
+#define __RELEASE_NUM 1
+#define __BUILD_NUM 1
#include <stdver.h>
|