[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:07:47 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=56b4a5e
The following commit has been merged in the master branch:
commit 56b4a5e177f5ebe05bef817e008cf24f08f53c70
Author: Martin Klapetek <mklapetek at kde.org>
Date: Wed Nov 13 10:53:53 2013 +0100
Check for text chat capability properly
Other half for fixing 324567 is checking for this capability in the
dialog.
Reviewed-by: David Edmundson
CCBUG: 324567
---
KTp/Models/contacts-list-model.cpp | 2 +-
KTp/contact.cpp | 9 +++++++++
KTp/contact.h | 2 ++
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/KTp/Models/contacts-list-model.cpp b/KTp/Models/contacts-list-model.cpp
index 8dc545b..dd35f94 100644
--- a/KTp/Models/contacts-list-model.cpp
+++ b/KTp/Models/contacts-list-model.cpp
@@ -136,7 +136,7 @@ QVariant KTp::ContactsListModel::data(const QModelIndex &index, int role) const
return contact->isBlocked();
case KTp::ContactCanTextChatRole:
- return true; //FIXME
+ return contact->textChatCapability();
case KTp::ContactCanFileTransferRole:
return contact->fileTransferCapability();
case KTp::ContactCanAudioCallRole:
diff --git a/KTp/contact.cpp b/KTp/contact.cpp
index 5bf3519..64dd49b 100644
--- a/KTp/contact.cpp
+++ b/KTp/contact.cpp
@@ -48,6 +48,15 @@ KTp::Presence KTp::Contact::presence() const
return KTp::Presence(Tp::Contact::presence());
}
+bool KTp::Contact::textChatCapability() const
+{
+ if (!manager()->connection()) {
+ return false;
+ }
+
+ return capabilities().textChats();
+}
+
bool KTp::Contact::audioCallCapability() const
{
if (! manager()->connection()) {
diff --git a/KTp/contact.h b/KTp/contact.h
index 05bcf00..a0a1da8 100644
--- a/KTp/contact.h
+++ b/KTp/contact.h
@@ -35,6 +35,8 @@ public:
KTp::Presence presence() const;
+ /** Returns true if text chats can be started with this contact*/
+ bool textChatCapability() const;
/** Returns true if audio calls can be started with this contact*/
bool audioCallCapability() const;
/** Returns true if video calls can be started with this contact*/
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list