[SCM] ktp-kded-integration-module packaging branch, master, updated. debian/15.12.1-2-382-gbd961c2

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:15:34 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-kded-module.git;a=commitdiff;h=13b81af

The following commit has been merged in the master branch:
commit 13b81af5cc8f79cbd4edd77dddd020078afec7fb
Author: David Edmundson <kde at davidedmundson.co.uk>
Date:   Thu Dec 26 16:06:32 2013 +0100

    Block contacts when denying requests
    
    This prevents them from reappearing
    
    BUG: 297994
    REVIEW: 114671
    FIXED-IN: 0.7.1
---
 contact-request-handler.cpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/contact-request-handler.cpp b/contact-request-handler.cpp
index 014b9cb..1b13194 100644
--- a/contact-request-handler.cpp
+++ b/contact-request-handler.cpp
@@ -43,7 +43,7 @@ Q_DECLARE_METATYPE(Tp::ContactPtr)
 
 static bool kde_tp_filter_contacts_by_publication_status(const Tp::ContactPtr &contact)
 {
-    return contact->publishState() == Tp::Contact::PresenceStateAsk;
+    return contact->publishState() == Tp::Contact::PresenceStateAsk && !contact->isBlocked();
 }
 
 ContactRequestHandler::ContactRequestHandler(const Tp::AccountManagerPtr& am, QObject *parent)
@@ -326,14 +326,21 @@ void ContactRequestHandler::onContactRequestDenied()
         QHash<QString, Tp::ContactPtr>::const_iterator i = m_pendingContacts.constFind(contactId);
         while (i != m_pendingContacts.constEnd() && i.key() == contactId) {
             if (!i.value()->manager().isNull()) {
+                //don't publish our presence to that user
                 Tp::PendingOperation *op = i.value()->manager()->removePresencePublication(QList< Tp::ContactPtr >() << i.value());
                 op->setProperty("__contact", QVariant::fromValue(i.value()));
                 operations.append(op);
+
+                //and block that contact
+                if (i.value()->manager()->canBlockContacts()) {
+                    Tp::PendingOperation *blockOp = i.value()->manager()->blockContacts(QList<Tp::ContactPtr>() << i.value());
+                    operations.append(blockOp);
+                }
             }
             ++i;
         }
 
-        // Take the first value, if any
+        // Wait until all operations complete
         if (!operations.isEmpty()) {
             Tp::ContactPtr contact = m_pendingContacts.find(contactId).value();
 

-- 
ktp-kded-integration-module packaging



More information about the pkg-kde-commits mailing list