[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9

Maximiliano Curia maxy at moszumanska.debian.org
Mon May 9 09:06:30 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=8efa283

The following commit has been merged in the master branch:
commit 8efa2831a41126a3446105389d8a4c16d5e4aaca
Author: Lasath Fernando <kde at lasath.org>
Date:   Sun Mar 3 15:19:49 2013 +1100

    Implement MessageProcessor::preprocessMessage()
    
    It iterates through all the loaded filters, in turn calling
    filterOutgoingMessage().
    
    Maybe in the future there should be a separate list of filters,
    and possibly a flag in the desktop file.
---
 KTp/message-processor.cpp | 13 +++++++++++++
 KTp/message-processor.h   |  2 ++
 2 files changed, 15 insertions(+)

diff --git a/KTp/message-processor.cpp b/KTp/message-processor.cpp
index 82b11eb..68414bb 100644
--- a/KTp/message-processor.cpp
+++ b/KTp/message-processor.cpp
@@ -166,3 +166,16 @@ KTp::Message MessageProcessor::processMessage(KTp::Message message, const KTp::M
     }
     return message;
 }
+
+KTp::Message MessageProcessor::preprocessMessage(const QString &messageText, const Tp::AccountPtr &account, const Tp::TextChannelPtr &channel)
+{
+    KTp::MessageContext context(account, channel);
+    KTp::Message message(messageText, context);
+
+    Q_FOREACH (AbstractMessageFilter *filter, d->filters) {
+        kDebug() << "running outgoing filter : " << filter->metaObject()->className();
+        filter->filterOutgoingMessage(message, context);
+    }
+
+    return message;
+}
diff --git a/KTp/message-processor.h b/KTp/message-processor.h
index 7cd4d87..d6992b8 100644
--- a/KTp/message-processor.h
+++ b/KTp/message-processor.h
@@ -58,6 +58,8 @@ class KTP_EXPORT MessageProcessor : public QObject
     KTp::Message processMessage(const Tp::ReceivedMessage &message, const Tp::AccountPtr &account, const Tp::TextChannelPtr &channel);
     KTp::Message processMessage(const Tpl::TextEventPtr &message, const Tp::AccountPtr &account, const Tp::TextChannelPtr &channel);
 
+    KTp::Message preprocessMessage(const QString &messageText, const Tp::AccountPtr &account, const Tp::TextChannelPtr &channel);
+
   protected:
     KTp::Message processMessage(KTp::Message message, const KTp::MessageContext &context);
     explicit MessageProcessor();

-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list