summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2014-06-03 17:41:45 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2014-06-03 17:41:45 +0000
commitb7c991c686cd440cb8b81745ec587fbf29deb97d (patch)
treec5d285d2eb29d7db20688531ec312cf14151f206
parent74a6e6b40e0254fecee1203fcb6b23a8e2abafcc (diff)
IEView: Added support for custom database events (e.g. status changes) (fixes #694)
git-svn-id: http://svn.miranda-ng.org/main/trunk@9405 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/IEView/src/HistoryHTMLBuilder.cpp3
-rw-r--r--plugins/IEView/src/ScriverHTMLBuilder.cpp3
-rw-r--r--plugins/IEView/src/TabSRMMHTMLBuilder.cpp2
-rw-r--r--plugins/IEView/src/Utils.cpp12
-rw-r--r--plugins/IEView/src/Utils.h2
5 files changed, 20 insertions, 2 deletions
diff --git a/plugins/IEView/src/HistoryHTMLBuilder.cpp b/plugins/IEView/src/HistoryHTMLBuilder.cpp
index 93349151da..f7b08ae861 100644
--- a/plugins/IEView/src/HistoryHTMLBuilder.cpp
+++ b/plugins/IEView/src/HistoryHTMLBuilder.cpp
@@ -73,8 +73,9 @@ bool HistoryHTMLBuilder::isDbEventShown(DBEVENTINFO * dbei)
switch (dbei->eventType) {
case EVENTTYPE_MESSAGE:
return 1;
+ default:
+ return Utils::DbEventIsForHistory(dbei);
}
- return 1;
}
char *HistoryHTMLBuilder::timestampToString(DWORD dwFlags, time_t check) {
diff --git a/plugins/IEView/src/ScriverHTMLBuilder.cpp b/plugins/IEView/src/ScriverHTMLBuilder.cpp
index 17fd3bc2d3..fd6293afbc 100644
--- a/plugins/IEView/src/ScriverHTMLBuilder.cpp
+++ b/plugins/IEView/src/ScriverHTMLBuilder.cpp
@@ -76,8 +76,9 @@ bool ScriverHTMLBuilder::isDbEventShown(DBEVENTINFO * dbei)
return 1;
case EVENTTYPE_FILE:
return 1;
+ default:
+ return Utils::DbEventIsForMsgWindow(dbei);
}
- return 0;
}
void ScriverHTMLBuilder::loadMsgDlgFont(int i, LOGFONTA * lf, COLORREF * colour) {
diff --git a/plugins/IEView/src/TabSRMMHTMLBuilder.cpp b/plugins/IEView/src/TabSRMMHTMLBuilder.cpp
index 5387d09fa3..6b0b3ea6aa 100644
--- a/plugins/IEView/src/TabSRMMHTMLBuilder.cpp
+++ b/plugins/IEView/src/TabSRMMHTMLBuilder.cpp
@@ -100,6 +100,8 @@ bool TabSRMMHTMLBuilder::isDbEventShown(DWORD dwFlags, DBEVENTINFO *dbei)
case EVENTTYPE_ADDED:
case EVENTTYPE_AUTHREQUEST:
return 0;
+ default:
+ return Utils::DbEventIsForMsgWindow(dbei);
}
return 1;
}
diff --git a/plugins/IEView/src/Utils.cpp b/plugins/IEView/src/Utils.cpp
index 4c7b0ddf8d..37c0da77f2 100644
--- a/plugins/IEView/src/Utils.cpp
+++ b/plugins/IEView/src/Utils.cpp
@@ -185,3 +185,15 @@ void Utils::appendIcon(char **str, int *sizeAlloced, const char *iconFile)
{
Utils::appendText(str, sizeAlloced, "<img class=\"img\" src=\"file://%s/plugins/ieview/%s\"/> ", workingDirUtf8, iconFile);
}
+
+bool Utils::DbEventIsForMsgWindow(DBEVENTINFO *dbei)
+{
+ DBEVENTTYPEDESCR *et = (DBEVENTTYPEDESCR*)CallService(MS_DB_EVENT_GETTYPE, (WPARAM)dbei->szModule, (LPARAM)dbei->eventType);
+ return et && (et->flags & DETF_MSGWINDOW);
+}
+
+bool Utils::DbEventIsForHistory(DBEVENTINFO *dbei)
+{
+ DBEVENTTYPEDESCR *et = (DBEVENTTYPEDESCR*)CallService(MS_DB_EVENT_GETTYPE, (WPARAM)dbei->szModule, (LPARAM)dbei->eventType);
+ return et && (et->flags & DETF_HISTORY);
+} \ No newline at end of file
diff --git a/plugins/IEView/src/Utils.h b/plugins/IEView/src/Utils.h
index 124ce51673..87f107ce09 100644
--- a/plugins/IEView/src/Utils.h
+++ b/plugins/IEView/src/Utils.h
@@ -42,6 +42,8 @@ public:
static void convertPath(wchar_t *path);
static char *escapeString(const char *a);
static int detectURL(const wchar_t *text);
+ static bool DbEventIsForMsgWindow(DBEVENTINFO *dbei);
+ static bool DbEventIsForHistory(DBEVENTINFO *dbei);
};
#endif