[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:06:35 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=d2ab105
The following commit has been merged in the master branch:
commit d2ab105e164565ec23a4e6997e9f0195ec4ee0be
Author: Dario Freddi <dario.freddi at collabora.co.uk>
Date: Fri Jun 3 00:55:00 2011 +0300
Automatically authorize presence publication to contacts that we are subscribed to.
When we request a new contact to be added in our contact list and this contact
approves the request, this contact also has to request our presence subscription
and we need to approve it without showing an authorization dialog again,
because that would be confusing for users; they would add a new contact
and receive a dialog saying that this contact has requested their subscription.
---
main-widget.cpp | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/main-widget.cpp b/main-widget.cpp
index 12b2b8e..7b72e74 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -1128,17 +1128,27 @@ void MainWidget::onAccountsPresenceStatusFiltered()
void MainWidget::onPresencePublicationRequested(const Tp::Contacts& contacts)
{
foreach (const Tp::ContactPtr &contact, contacts) {
- if (KMessageBox::questionYesNo(this, i18n("The contact %1 added you to their contact list. "
+ Tp::ContactManagerPtr manager = contact->manager();
+ Tp::PendingOperation *op = 0;
+
+ if (contact->subscriptionState() == Tp::Contact::PresenceStateYes) {
+ op = manager->authorizePresencePublication(QList< Tp::ContactPtr >() << contact);
+ } else if (KMessageBox::questionYesNo(this, i18n("The contact %1 added you to their contact list. "
"Do you want to allow this person to see your presence "
"and add them to your contact list?", contact->id()),
i18n("Subscription request")) == KMessageBox::Yes) {
- Tp::ContactManagerPtr manager = contact->manager();
- manager->authorizePresencePublication(QList< Tp::ContactPtr >() << contact);
+
+ op = manager->authorizePresencePublication(QList< Tp::ContactPtr >() << contact);
if (manager->canRequestPresenceSubscription() && contact->subscriptionState() == Tp::Contact::PresenceStateNo) {
manager->requestPresenceSubscription(QList< Tp::ContactPtr >() << contact);
}
}
+
+ if (op) {
+ connect(op, SIGNAL(finished(Tp::PendingOperation*)),
+ SLOT(slotGenericOperationFinished(Tp::PendingOperation*)));
+ }
}
}
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list