[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:22:01 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=0e8b2bc
The following commit has been merged in the master branch:
commit 0e8b2bcc2be9ce9dee0111ba0af578a5f41375de
Author: Lasath Fernando <kde at lasath.org>
Date: Mon Jun 25 10:46:20 2012 +1000
Hardcode EscapeFilter
As promised, this re-adds Escaping, except this time as a hardcoded
filter, becuase we determined that such an essential security
feature should not be optional.
---
lib/CMakeLists.txt | 1 +
lib/filters.h | 7 +++++++
lib/message-processor.cpp | 13 +++----------
lib/message-processor.h | 1 +
4 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index eec5c50..f172936 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -16,6 +16,7 @@ set(ktpchat_SRCS
abstract-message-filter.cpp
message-processor.cpp
url-filter.cpp
+ escape-filter.cpp
)
set(ktpchat_HDRS
diff --git a/lib/filters.h b/lib/filters.h
index cb9b20a..4e96ae0 100644
--- a/lib/filters.h
+++ b/lib/filters.h
@@ -30,4 +30,11 @@ public:
void filterMessage(Message &message);
};
+class EscapeFilter : public AbstractMessageFilter
+{
+public:
+ explicit EscapeFilter(QObject *parent = 0);
+ virtual void filterMessage(Message& message);
+};
+
#endif
diff --git a/lib/message-processor.cpp b/lib/message-processor.cpp
index 2a8770f..926bef7 100644
--- a/lib/message-processor.cpp
+++ b/lib/message-processor.cpp
@@ -48,17 +48,10 @@ MessageProcessor* MessageProcessor::instance()
MessageProcessor::MessageProcessor()
{
+ m_filters.append(new EscapeFilter(this));
+ m_filters.append(new UrlFilter(this));
+
loadAllPlugins();
- m_filters.prepend(new UrlFilter(this));
-
- //FIXME: Massive hack to not escape URLs.
- Q_FOREACH (AbstractMessageFilter *filter, m_filters) {
- if (QLatin1String(filter->metaObject()->className()) == QLatin1String("EscapeFilter")) {
- m_filters.removeOne(filter);
- m_filters.prepend(filter);
- break;
- }
- }
}
diff --git a/lib/message-processor.h b/lib/message-processor.h
index 246f331..08cc386 100644
--- a/lib/message-processor.h
+++ b/lib/message-processor.h
@@ -37,6 +37,7 @@ class AbstractMessageFilter;
//each thing that displays message will have an instance of this
class KDE_TELEPATHY_CHAT_EXPORT MessageProcessor : public QObject
{
+Q_OBJECT
public:
static MessageProcessor* instance();
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list