summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_srmm_int.h4
-rw-r--r--libs/win32/mir_app.libbin238528 -> 238768 bytes
-rw-r--r--libs/win64/mir_app.libbin235466 -> 235706 bytes
-rw-r--r--plugins/Scriver/src/msgs.cpp32
-rw-r--r--plugins/TabSRMM/src/container.cpp13
-rw-r--r--plugins/TabSRMM/src/globals.cpp16
-rw-r--r--plugins/TabSRMM/src/mim.cpp14
-rw-r--r--src/core/stdmsg/src/msgs.cpp32
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
-rw-r--r--src/mir_app/src/srmm_util.cpp17
11 files changed, 38 insertions, 92 deletions
diff --git a/include/m_srmm_int.h b/include/m_srmm_int.h
index 2ba5f5cc00..ad53c773f3 100644
--- a/include/m_srmm_int.h
+++ b/include/m_srmm_int.h
@@ -287,6 +287,10 @@ EXTERN_C MIR_APP_DLL(DWORD) CALLBACK Srmm_LogStreamCallback(DWORD_PTR dwCookie,
#endif
/////////////////////////////////////////////////////////////////////////////////////////
+
+MIR_APP_DLL(void) Srmm_AddEvent(MCONTACT hContact, MEVENT hDbEvent);
+
+/////////////////////////////////////////////////////////////////////////////////////////
// sends a message to all SRMM windows
EXTERN_C MIR_APP_DLL(void) Srmm_Broadcast(UINT, WPARAM, LPARAM);
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib
index 4cf5bfb4d5..13d274f01f 100644
--- a/libs/win32/mir_app.lib
+++ b/libs/win32/mir_app.lib
Binary files differ
diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib
index ba6e0366a5..9fe3b3ff22 100644
--- a/libs/win64/mir_app.lib
+++ b/libs/win64/mir_app.lib
Binary files differ
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index e939a1c69e..8302c903ce 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -108,19 +108,9 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDbEvent)
}
}
- if (hwnd == nullptr || !IsWindowVisible(GetParent(hwnd))) {
- wchar_t toolTip[256];
- mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(hContact));
-
- CLISTEVENT cle = {};
- cle.flags = CLEF_UNICODE;
- cle.hContact = hContact;
- cle.hDbEvent = hDbEvent;
- cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
- cle.pszService = MS_MSG_READMESSAGE;
- cle.szTooltip.w = toolTip;
- g_clistApi.pfnAddEvent(&cle);
- }
+ if (hwnd == nullptr || !IsWindowVisible(GetParent(hwnd)))
+ Srmm_AddEvent(hContact, hDbEvent);
+
return 0;
}
@@ -263,20 +253,8 @@ static void RestoreUnreadMessageAlerts(void)
}
}
- wchar_t toolTip[256];
-
- CLISTEVENT cle = {};
- cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
- cle.pszService = MS_MSG_READMESSAGE;
- cle.flags = CLEF_UNICODE;
- cle.szTooltip.w = toolTip;
-
- for (auto &e : arEvents) {
- mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(e->hContact));
- cle.hContact = e->hContact;
- cle.hDbEvent = e->hEvent;
- g_clistApi.pfnAddEvent(&cle);
- }
+ for (auto &e : arEvents)
+ Srmm_AddEvent(e->hContact, e->hEvent);
}
void CMsgDialog::SetStatusText(const wchar_t *wszText, HICON hIcon)
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index 2c6c218631..2d64f9f681 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -2346,18 +2346,7 @@ void TSAPI AutoCreateWindow(MCONTACT hContact, MEVENT hDbEvent)
if (!(dbei.flags & DBEF_READ)) {
AddUnreadContact(hContact);
-
- wchar_t toolTip[256];
- mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(hContact));
-
- CLISTEVENT cle = {};
- cle.hContact = hContact;
- cle.hDbEvent = hDbEvent;
- cle.flags = CLEF_UNICODE;
- cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
- cle.pszService = MS_MSG_READMESSAGE;
- cle.szTooltip.w = toolTip;
- g_clistApi.pfnAddEvent(&cle);
+ Srmm_AddEvent(hContact, hDbEvent);
}
}
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 397e829dc1..7c7a649412 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -455,20 +455,8 @@ void CGlobals::RestoreUnreadMessageAlerts(void)
}
}
- wchar_t toolTip[256];
-
- CLISTEVENT cle = {};
- cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
- cle.pszService = MS_MSG_READMESSAGE;
- cle.flags = CLEF_UNICODE;
- cle.szTooltip.w = toolTip;
-
- for (auto &e : arEvents) {
- mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(e->hContact));
- cle.hContact = e->hContact;
- cle.hDbEvent = e->hEvent;
- g_clistApi.pfnAddEvent(&cle);
- }
+ for (auto &e : arEvents)
+ Srmm_AddEvent(e->hContact, e->hEvent);
}
void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c)
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index 7412bd0474..434472f9b3 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -286,6 +286,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM nSecs)
if (nSecs) {
wchar_t szTip[256];
mir_snwprintf(szTip, TranslateT("%s is typing a message"), Clist_GetContactDisplayName(hContact));
+
if (fShowOnClist && g_plugin.getByte("ShowTypingBalloon", 0))
Clist_TrayNotifyW(nullptr, TranslateT("Typing notification"), szTip, NIIF_INFO, 1000 * 4);
@@ -446,18 +447,7 @@ nowindowcreate:
// the contact list for flashing
if (!(dbei.flags & DBEF_READ)) {
AddUnreadContact(hContact);
-
- wchar_t toolTip[256];
- mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(hContact));
-
- CLISTEVENT cle = {};
- cle.hContact = hContact;
- cle.hDbEvent = hDbEvent;
- cle.flags = CLEF_UNICODE;
- cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
- cle.pszService = MS_MSG_READMESSAGE;
- cle.szTooltip.w = toolTip;
- g_clistApi.pfnAddEvent(&cle);
+ Srmm_AddEvent(hContact, hDbEvent);
}
return 0;
}
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index 121856ce37..d2b21d2173 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -65,13 +65,13 @@ static int SRMMStatusToPf2(int status)
return 0;
}
-static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
+static int MessageEventAdded(WPARAM hContact, LPARAM hDbEvent)
{
if (hContact == 0 || Contact::IsGroupChat(hContact))
return 0;
DBEVENTINFO dbei = {};
- if (db_event_get(lParam, &dbei))
+ if (db_event_get(hDbEvent, &dbei))
return 0;
if (dbei.flags & (DBEF_SENT | DBEF_READ) || !(dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei)))
@@ -105,17 +105,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
}
}
- wchar_t toolTip[256];
- mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(hContact));
-
- CLISTEVENT cle = {};
- cle.hContact = hContact;
- cle.hDbEvent = lParam;
- cle.flags = CLEF_UNICODE;
- cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
- cle.pszService = MS_MSG_READMESSAGE;
- cle.szTooltip.w = toolTip;
- g_clistApi.pfnAddEvent(&cle);
+ Srmm_AddEvent(hContact, hDbEvent);
return 0;
}
@@ -283,20 +273,8 @@ static void RestoreUnreadMessageAlerts(void)
}
}
- wchar_t toolTip[256];
-
- CLISTEVENT cle = {};
- cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
- cle.pszService = MS_MSG_READMESSAGE;
- cle.flags = CLEF_UNICODE;
- cle.szTooltip.w = toolTip;
-
- for (auto &e : arEvents) {
- mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(e->hContact));
- cle.hContact = e->hContact;
- cle.hDbEvent = e->hEvent;
- g_clistApi.pfnAddEvent(&cle);
- }
+ for (auto &e : arEvents)
+ Srmm_AddEvent(e->hContact, e->hEvent);
}
void RegisterSRMMFonts(void);
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index e994cf236b..d662635947 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -824,3 +824,4 @@ Srmm_CreateHotkey @886 NONAME
?getMStringU@PROTO_INTERFACE@@QAE?AV?$CMStringT@DV?$ChTraitsCRT@D@@@@PBD0@Z @939 NONAME
?OnEventDeleted@PROTO_INTERFACE@@UAEXII@Z @940 NONAME
Chat_IsMuted @941 NONAME
+?Srmm_AddEvent@@YGXII@Z @942 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index c953a52884..e88cb7f181 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -824,3 +824,4 @@ Srmm_CreateHotkey @886 NONAME
?getMStringU@PROTO_INTERFACE@@QEAA?AV?$CMStringT@DV?$ChTraitsCRT@D@@@@PEBD0@Z @939 NONAME
?OnEventDeleted@PROTO_INTERFACE@@UEAAXII@Z @940 NONAME
Chat_IsMuted @941 NONAME
+?Srmm_AddEvent@@YAXII@Z @942 NONAME
diff --git a/src/mir_app/src/srmm_util.cpp b/src/mir_app/src/srmm_util.cpp
index 080ff4ae5d..a6750fd86b 100644
--- a/src/mir_app/src/srmm_util.cpp
+++ b/src/mir_app/src/srmm_util.cpp
@@ -115,6 +115,23 @@ MIR_APP_DLL(CMsgDialog*) Srmm_FindDialog(MCONTACT hContact)
}
/////////////////////////////////////////////////////////////////////////////////////////
+
+MIR_APP_DLL(void) Srmm_AddEvent(MCONTACT hContact, MEVENT hDbEvent)
+{
+ wchar_t toolTip[256];
+ mir_snwprintf(toolTip, TranslateT("Message from %s"), Clist_GetContactDisplayName(hContact));
+
+ CLISTEVENT cle = {};
+ cle.hContact = hContact;
+ cle.hDbEvent = hDbEvent;
+ cle.flags = CLEF_UNICODE;
+ cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
+ cle.pszService = MS_MSG_READMESSAGE;
+ cle.szTooltip.w = toolTip;
+ g_clistApi.pfnAddEvent(&cle);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
// serializes all thread-unsafe operation to the first thread
struct SSTParam