[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:20 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=93973dd
The following commit has been merged in the master branch:
commit 93973dd753b1a325184562ae2e2afbc244304251
Author: Lasath Fernando <kde at lasath.org>
Date: Mon Feb 25 22:33:34 2013 -0500
Make highlight filter only check current account
Instead of having a second Tp::AccountManager and using it to check
ALL account names, only check the name of the account that the
message came in.
---
filters/highlight/highlight-filter.cpp | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/filters/highlight/highlight-filter.cpp b/filters/highlight/highlight-filter.cpp
index 38b998d..b54c8aa 100644
--- a/filters/highlight/highlight-filter.cpp
+++ b/filters/highlight/highlight-filter.cpp
@@ -31,15 +31,12 @@
class HighlightFilter::Private
{
public:
- Tp::AccountManagerPtr accountManager;
KUser user;
};
HighlightFilter::HighlightFilter(QObject *parent, const QVariantList &) :
KTp::AbstractMessageFilter(parent), d(new Private)
{
- d->accountManager = Tp::AccountManager::create(QDBusConnection::sessionBus());
- d->accountManager->becomeReady();
}
HighlightFilter::~HighlightFilter()
@@ -47,20 +44,18 @@ HighlightFilter::~HighlightFilter()
delete d;
}
-void HighlightFilter::filterMessage(KTp::Message &message, const KTp::MessageContext&)
+void HighlightFilter::filterMessage(KTp::Message &message,
+ const KTp::MessageContext &context)
{
QString msg = message.mainMessagePart();
- Q_FOREACH (Tp::AccountPtr ptr, d->accountManager->allAccounts()) {
- if (msg.contains(ptr->nickname(), Qt::CaseInsensitive)) {
- kDebug() << "message contains user alias :" << ptr->nickname();
- message.setProperty("highlight", true);
- }
+ if (msg.contains(context.account()->nickname(), Qt::CaseInsensitive)) {
+ message.setProperty("highlight", true);
+ }
- if (msg.contains(d->user.loginName(), Qt::CaseInsensitive)) {
- kDebug() << "messge contains user login name" << d->user.loginName();
- message.setProperty("highlight", true);
- }
+ if (msg.contains(d->user.loginName(), Qt::CaseInsensitive)) {
+ kDebug() << "messge contains user login name" << d->user.loginName();
+ message.setProperty("highlight", true);
}
if (message.property("highlight").toBool()){
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list