summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-12-19 21:16:14 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-12-19 21:16:14 +0000
commite71ae69a68419f5e42ceb93234f7c470a54ed804 (patch)
tree9360c5975a96d1bcb12e4ce07c800abc008b4326 /plugins/TabSRMM
parent8b8a98c49ef56525d35f0482a7b43377ebb80529 (diff)
minor contacts processing improvements
git-svn-id: http://svn.miranda-ng.org/main/trunk@7291 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r--plugins/TabSRMM/src/mim.cpp2
-rw-r--r--plugins/TabSRMM/src/msglog.cpp94
2 files changed, 46 insertions, 50 deletions
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index 18242609b0..b3282248e6 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -541,7 +541,7 @@ int CMimAPI::MessageEventAdded(WPARAM wParam, LPARAM lParam)
BOOL isCustomEvent = IsCustomEvent(dbei.eventType);
BOOL isShownCustomEvent = DbEventIsForMsgWindow(&dbei);
- if (dbei.flags & DBEF_SENT || (isCustomEvent && !isShownCustomEvent) || dbei.flags & DBEF_READ)
+ if ((dbei.flags & (DBEF_READ | DBEF_SENT)) || (isCustomEvent && !isShownCustomEvent))
return 0;
CallServiceSync(MS_CLIST_REMOVEEVENT, wParam, 1);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index 6a1d0aa1c3..0b32eab640 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -978,60 +978,56 @@ static char *Template_CreateRTFFromDbEvent(TWindowData *dat, HANDLE hContact, HA
if (bIsStatusChangeEvent)
dbei.eventType = EVENTTYPE_STATUSCHANGE;
switch (dbei.eventType) {
- case EVENTTYPE_MESSAGE:
- case EVENTTYPE_ERRMSG:
- case EVENTTYPE_STATUSCHANGE: {
- if (bIsStatusChangeEvent || dbei.eventType == EVENTTYPE_ERRMSG) {
- if (dbei.eventType == EVENTTYPE_ERRMSG && dbei.cbBlob == 0)
- break;
- if (dbei.eventType == EVENTTYPE_ERRMSG) {
- if (!skipFont)
- AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "\\line%s ", GetRTFFont(bIsStatusChangeEvent ? H_MSGFONTID_STATUSCHANGES : MSGFONTID_MYMSG));
- else
- AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "\\line ");
- } else {
- if (!skipFont)
- AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "%s ", GetRTFFont(bIsStatusChangeEvent ? H_MSGFONTID_STATUSCHANGES : MSGFONTID_MYMSG));
- }
- } else {
+ case EVENTTYPE_MESSAGE:
+ case EVENTTYPE_ERRMSG:
+ case EVENTTYPE_STATUSCHANGE:
+ if (bIsStatusChangeEvent || dbei.eventType == EVENTTYPE_ERRMSG) {
+ if (dbei.eventType == EVENTTYPE_ERRMSG && dbei.cbBlob == 0)
+ break;
+ if (dbei.eventType == EVENTTYPE_ERRMSG) {
if (!skipFont)
- AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "%s ", GetRTFFont(isSent ? MSGFONTID_MYMSG + iFontIDOffset : MSGFONTID_YOURMSG + iFontIDOffset));
- }
-
- if (rtfMessage != NULL) {
- AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "%s", rtfMessage);
- } else {
- AppendUnicodeToBuffer(&buffer, &bufferEnd, &bufferAlloced, formatted, MAKELONG(isSent, dat->isHistory));
+ AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "\\line%s ", GetRTFFont(bIsStatusChangeEvent ? H_MSGFONTID_STATUSCHANGES : MSGFONTID_MYMSG));
+ else
+ AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "\\line ");
}
- AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "%s", "\\b0\\ul0\\i0 ");
- break;
+ else if (!skipFont)
+ AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "%s ", GetRTFFont(bIsStatusChangeEvent ? H_MSGFONTID_STATUSCHANGES : MSGFONTID_MYMSG));
}
- case EVENTTYPE_FILE:
- if (!skipFont)
- AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "%s ", GetRTFFont(isSent ? MSGFONTID_MYMISC + iFontIDOffset : MSGFONTID_YOURMISC + iFontIDOffset));
- {
- char* szFileName = (char *)dbei.pBlob + sizeof(DWORD);
- char* szDescr = szFileName + lstrlenA(szFileName) + 1;
- TCHAR* tszFileName = DbGetEventStringT( &dbei, szFileName );
- if ( *szDescr != 0 ) {
- TCHAR* tszDescr = DbGetEventStringT( &dbei, szDescr );
- TCHAR buf[1000];
- mir_sntprintf(buf, SIZEOF(buf), _T("%s (%s)"), tszFileName, tszDescr);
- AppendUnicodeToBuffer(&buffer, &bufferEnd, &bufferAlloced, buf, 0 );
- mir_free(tszDescr);
- }
- else {
- AppendUnicodeToBuffer(&buffer, &bufferEnd, &bufferAlloced, tszFileName, 0 );
- }
- mir_free( tszFileName );
+ else if (!skipFont)
+ AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "%s ", GetRTFFont(isSent ? MSGFONTID_MYMSG + iFontIDOffset : MSGFONTID_YOURMSG + iFontIDOffset));
+
+ if (rtfMessage != NULL)
+ AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "%s", rtfMessage);
+ else
+ AppendUnicodeToBuffer(&buffer, &bufferEnd, &bufferAlloced, formatted, MAKELONG(isSent, dat->isHistory));
+
+ AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "%s", "\\b0\\ul0\\i0 ");
+ break;
+
+ case EVENTTYPE_FILE:
+ if (!skipFont)
+ AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "%s ", GetRTFFont(isSent ? MSGFONTID_MYMISC + iFontIDOffset : MSGFONTID_YOURMISC + iFontIDOffset));
+ {
+ char *szFileName = (char *)dbei.pBlob + sizeof(DWORD);
+ char *szDescr = szFileName + lstrlenA(szFileName) + 1;
+ TCHAR *tszFileName = DbGetEventStringT(&dbei, szFileName);
+ if (*szDescr != 0) {
+ TCHAR *tszDescr = DbGetEventStringT(&dbei, szDescr);
+ TCHAR buf[1000];
+ mir_sntprintf(buf, SIZEOF(buf), _T("%s (%s)"), tszFileName, tszDescr);
+ AppendUnicodeToBuffer(&buffer, &bufferEnd, &bufferAlloced, buf, 0);
+ mir_free(tszDescr);
}
- break;
- default:
- if (IsCustomEvent(dbei.eventType)) {
- TCHAR* tszText = DbGetEventTextT(&dbei, CP_ACP);
- AppendUnicodeToBuffer(&buffer, &bufferEnd, &bufferAlloced, tszText, 0);
+ else {
+ AppendUnicodeToBuffer(&buffer, &bufferEnd, &bufferAlloced, tszFileName, 0);
}
- break;
+ mir_free(tszFileName);
+ }
+ break;
+
+ default:
+ TCHAR* tszText = DbGetEventTextT(&dbei, CP_ACP);
+ AppendUnicodeToBuffer(&buffer, &bufferEnd, &bufferAlloced, tszText, 0);
}
break;
case '*': // bold