summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2014-08-12 19:39:26 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2014-08-12 19:39:26 +0000
commit442fbaf1d2df12c1f359b0ab64ddcecaff250628 (patch)
treeb71585f58cbe0ad37e7b87545d4158790784af4c
parent79f5521815e208cb694bbc814ee88429e20328b6 (diff)
- Fixed status changes not being instantly displayed (fixes #553)
- Fixed icon for status changes - Changed background setting to be changed with color settings - Fixed status bar icons git-svn-id: http://svn.miranda-ng.org/main/trunk@10171 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp11
-rw-r--r--src/core/stdmsg/src/msglog.cpp2
-rw-r--r--src/core/stdmsg/src/msgoptions.cpp2
-rw-r--r--src/core/stdmsg/src/statusicon.cpp4
4 files changed, 12 insertions, 7 deletions
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index f0649c253e..56b6fb43c4 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -1307,14 +1307,16 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
- if (DbEventIsShown(&dbei) && !(dbei.flags & DBEF_READ)) {
- if ((dbei.eventType == EVENTTYPE_MESSAGE) && !(dbei.flags & DBEF_SENT)) {
+ bool isMessage = (dbei.eventType == EVENTTYPE_MESSAGE), isSent = ((dbei.flags & DBEF_SENT) != 0);
+ if (DbEventIsShown(&dbei)) {
+ // Sounds *only* for sent messages, not for custom events
+ if (isMessage && !isSent) {
if (GetForegroundWindow() == hwndDlg)
SkinPlaySound("RecvMsgActive");
else
SkinPlaySound("RecvMsgInactive");
}
- if ((dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei)) && dat->hwndStatus && !(dbei.flags & DBEF_SENT)) {
+ if ((isMessage || DbEventIsForMsgWindow(&dbei)) && dat->hwndStatus && !isSent) {
dat->lastMessage = dbei.timestamp;
SendMessage(hwndDlg, DM_UPDATELASTMESSAGE, 0, 0);
}
@@ -1323,7 +1325,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
else
SendMessage(hwndDlg, DM_REMAKELOG, 0, 0);
- if (!(dbei.flags & DBEF_SENT)) {
+ // Flash window *only* for messages, not for custom events
+ if (isMessage && !isSent) {
if (GetActiveWindow() == hwndDlg && GetForegroundWindow() == hwndDlg) {
HWND hwndLog = GetDlgItem(hwndDlg, IDC_LOG);
if (GetWindowLongPtr(hwndLog, GWL_STYLE) & WS_VSCROLL) {
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp
index 8bcdfddd95..a10f615d95 100644
--- a/src/core/stdmsg/src/msglog.cpp
+++ b/src/core/stdmsg/src/msglog.cpp
@@ -277,7 +277,7 @@ static char *CreateRTFFromDbEvent(SrmmWindowData *dat, MCONTACT hContact, HANDLE
}
if (g_dat.flags & SMF_SHOWICONS) {
- int i = (dbei.eventType ? ((dbei.flags & DBEF_SENT) ? LOGICON_MSG_OUT : LOGICON_MSG_IN): LOGICON_MSG_NOTICE);
+ int i = ((dbei.eventType == EVENTTYPE_MESSAGE) ? ((dbei.flags & DBEF_SENT) ? LOGICON_MSG_OUT : LOGICON_MSG_IN): LOGICON_MSG_NOTICE);
AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "\\f0\\fs14");
while (bufferAlloced - bufferEnd < logIconBmpSize[i])
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp
index 909c94fc57..1ed478bc73 100644
--- a/src/core/stdmsg/src/msgoptions.cpp
+++ b/src/core/stdmsg/src/msgoptions.cpp
@@ -115,6 +115,8 @@ void RegisterSRMMFonts(void)
fontid.deffontsettings.style = fontOptionsList[i].defStyle;
_tcscpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace);
fontid.deffontsettings.charset = MsgDlgGetFontDefaultCharset(fontOptionsList[i].szDefFace);
+ _tcsncpy(fontid.backgroundGroup, LPGENT("Message log"),SIZEOF(fontid.backgroundGroup));
+ _tcsncpy(fontid.backgroundName, LPGENT("Background"),SIZEOF(fontid.backgroundName));
FontRegisterT(&fontid);
}
diff --git a/src/core/stdmsg/src/statusicon.cpp b/src/core/stdmsg/src/statusicon.cpp
index 4d2b0c8bf7..20932d34ea 100644
--- a/src/core/stdmsg/src/statusicon.cpp
+++ b/src/core/stdmsg/src/statusicon.cpp
@@ -41,8 +41,8 @@ void DrawStatusIcons(MCONTACT hContact, HDC hDC, RECT r, int gap)
int x = r.left;
int nIcon = 0;
- StatusIconData *sid = Srmm_GetNthIcon(hContact, nIcon++);
- while (sid != 0 && x < r.right) {
+ StatusIconData *sid;
+ while ((sid = Srmm_GetNthIcon(hContact, nIcon++)) != 0 && x < r.right) {
HICON hIcon = ((sid->flags & MBF_DISABLED) && sid->hIconDisabled) ? sid->hIconDisabled : sid->hIcon;
SetBkMode(hDC, TRANSPARENT);