summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp12
-rw-r--r--plugins/TabSRMM/src/mim.cpp9
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp17
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp14
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.h4
-rw-r--r--plugins/TabSRMM/src/msgs.cpp3
-rw-r--r--plugins/TabSRMM/src/msgs.h1
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp6
-rw-r--r--plugins/TabSRMM/src/version.h4
-rw-r--r--src/modules/metacontacts/meta_services.cpp24
10 files changed, 43 insertions, 51 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>
diff --git a/src/modules/metacontacts/meta_services.cpp b/src/modules/metacontacts/meta_services.cpp
index 7166c78ce9..1fed53f721 100644
--- a/src/modules/metacontacts/meta_services.cpp
+++ b/src/modules/metacontacts/meta_services.cpp
@@ -247,10 +247,9 @@ INT_PTR Meta_SendMessage(WPARAM wParam,LPARAM lParam)
* Retransmit the ACK sent by a simple contact so that it
* looks like it was the MetaContact that sends the ACK.
*
-* @param wParam : Allways set to 0.
-* @param lParam : Reference to a ACKDATA that contains
-information about the ACK.
-* @return 0 on success, 1 otherwise.
+* @param wParam : Allways set to 0.
+* @param lParam : Reference to a ACKDATA that contains information about the ACK.
+* @returns 0 on success, 1 otherwise.
*/
int Meta_HandleACK(WPARAM, LPARAM lParam)
@@ -356,7 +355,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam)
break;
}
}
- else if (!strcmp(dcws->szSetting, "Nick") && !dcws->value.type == DBVT_DELETED) {
+ else if (!strcmp(dcws->szSetting, "Nick") && dcws->value.type != DBVT_DELETED) {
// subcontact nick has changed - update metacontact
mir_snprintf(buffer, SIZEOF(buffer), "Nick%d", contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dcws->value);
@@ -371,8 +370,6 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam)
// copy nick to metacontact, if it's the most online
MCONTACT hMostOnline = Meta_GetMostOnline(ccMeta);
Meta_CopyContactNick(ccMeta, hMostOnline);
-
- return 0;
}
else if (!strcmp(dcws->szSetting, "IdleTS")) {
if (dcws->value.type == DBVT_DWORD)
@@ -406,10 +403,9 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam)
// copy nick to metacontact, if it's the most online
Meta_CopyContactNick(ccMeta, Meta_GetMostOnline(ccMeta));
- return 0;
}
// subcontact changing status
- else if (!strcmp(dcws->szSetting, "Status") && !dcws->value.type == DBVT_DELETED) {
+ else if (!strcmp(dcws->szSetting, "Status") && dcws->value.type != DBVT_DELETED) {
// update subcontact status setting
mir_snprintf(buffer, SIZEOF(buffer), "Status%d", contact_number);
db_set_w(ccMeta->contactID, META_PROTO, buffer, dcws->value.wVal);
@@ -420,7 +416,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam)
// set status to that of most online contact
MCONTACT hMostOnline = Meta_GetMostOnline(ccMeta);
if (hMostOnline != db_mc_getDefault(ccMeta->contactID))
- db_mc_notifyDefChange(ccMeta->contactID, hMostOnline);
+ db_mc_setDefault(ccMeta->contactID, hMostOnline, false);
Meta_CopyContactNick(ccMeta, hMostOnline);
Meta_FixStatus(ccMeta);
@@ -476,7 +472,7 @@ int Meta_ContactDeleted(WPARAM hContact, LPARAM lParam)
/** Call when we want to send a user is typing message
*
-* @param wParam \c HANDLE to the contact that we are typing to
+* @param wParam HANDLE to the contact that we are typing to
* @param lParam either PROTOTYPE_SELFTYPING_ON or PROTOTYPE_SELFTYPING_OFF
*/
INT_PTR Meta_UserIsTyping(WPARAM hMeta, LPARAM lParam)
@@ -501,7 +497,7 @@ INT_PTR Meta_UserIsTyping(WPARAM hMeta, LPARAM lParam)
/** Call when we want to receive a user is typing message
*
-* @param wParam \c HANDLE to the contact that is typing or not
+* @param wParam HANDLE to the contact that is typing or not
* @param lParam either PROTOTYPE_SELFTYPING_ON or PROTOTYPE_SELFTYPING_OFF
*/
@@ -538,7 +534,7 @@ int Meta_UserInfo(WPARAM wParam, LPARAM hMeta)
// record window open/close status for subs & metas
int Meta_MessageWindowEvent(WPARAM wParam, LPARAM lParam)
{
- MessageWindowEventData *mwed = (MessageWindowEventData *)lParam;
+ MessageWindowEventData *mwed = (MessageWindowEventData*)lParam;
if (mwed->uType == MSG_WINDOW_EVT_OPEN) {
DBCachedContact *cc = currDb->m_cache->GetCachedContact(mwed->hContact);
if (cc != NULL) {
@@ -725,7 +721,7 @@ INT_PTR Meta_GetAwayMsg(WPARAM wParam, LPARAM lParam)
INT_PTR Meta_GetAvatarInfo(WPARAM wParam, LPARAM lParam)
{
- PROTO_AVATAR_INFORMATIONT *AI = (PROTO_AVATAR_INFORMATIONT *)lParam;
+ PROTO_AVATAR_INFORMATIONT *AI = (PROTO_AVATAR_INFORMATIONT*)lParam;
DBCachedContact *cc = CheckMeta(AI->hContact);
if (cc == NULL)
return GAIR_NOAVATAR;