[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:23:23 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=7707abe

The following commit has been merged in the master branch:
commit 7707abe80a1b2911fefc44c385c2de6334eb00e4
Author: Lasath Fernando <kde at lasath.org>
Date:   Sat Mar 2 02:09:33 2013 -0500

    Make ChatWidget call NotifyFilter::filterMessage()
    
    I swear this violates abstraction, but I'm sure we'll come up with
    an elegant solution eventually.
---
 lib/chat-widget.cpp | 13 ++++++-------
 lib/chat-widget.h   |  3 ---
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index d2519b1..33136ee 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -169,14 +169,12 @@ ChatWidget::ChatWidget(const Tp::TextChannelPtr & channel, const Tp::AccountPtr
     }
 
     d->notifyFilter = new NotifyFilter(this);
-    KTp::MessageProcessor::instance()->appendFilter(d->notifyFilter);
 }
 
 ChatWidget::~ChatWidget()
 {
     saveSpellCheckingOption();
     d->channel->requestClose(); // ensure closing; does nothing, if already closed
-    KTp::MessageProcessor::instance()->removeFilter(d->notifyFilter);
     delete d;
 }
 
@@ -617,6 +615,12 @@ void ChatWidget::handleIncomingMessage(const Tp::ReceivedMessage &message)
             AdiumThemeContentInfo messageInfo(AdiumThemeMessageInfo::RemoteToLocal);
 
             KTp::Message processedMessage(KTp::MessageProcessor::instance()->processMessage(message, d->account, d->channel));
+
+            // FIXME: eventually find a way to make MessageProcessor allow per
+            //        instance filters.
+            d->notifyFilter->filterMessage(processedMessage,
+                                           KTp::MessageContext(d->account, d->channel));
+
             messageInfo.setMessage(processedMessage.finalizedMessage());
             messageInfo.setScript(processedMessage.finalizedScript());
 
@@ -648,11 +652,6 @@ void ChatWidget::handleIncomingMessage(const Tp::ReceivedMessage &message)
 
 }
 
-void ChatWidget::notifyAboutIncomingMessage(const Tp::ReceivedMessage & message)
-{
-    Q_ASSERT(false);
-}
-
 void ChatWidget::handleMessageSent(const Tp::Message &message, Tp::MessageSendingFlags, const QString&) /*Not sure what these other args are for*/
 {
     Tp::ContactPtr sender = d->channel->groupSelfContact();
diff --git a/lib/chat-widget.h b/lib/chat-widget.h
index a88e599..9eecc89 100644
--- a/lib/chat-widget.h
+++ b/lib/chat-widget.h
@@ -121,9 +121,6 @@ protected Q_SLOTS:
     /** Show the received message in the chat window*/
     void handleIncomingMessage(const Tp::ReceivedMessage &message);
 
-    /** Show notification about a received message */
-    void notifyAboutIncomingMessage(const Tp::ReceivedMessage &message);
-
     /** Show the message sent in the chat window*/
     void handleMessageSent(const Tp::Message &message,
                            Tp::MessageSendingFlags flags,

-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list