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


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

The following commit has been merged in the master branch:
commit 0661a0c4d435b625ba105b7cb0984f6cecc95b19
Author: Marcin Ziemiński <zieminn at gmail.com>
Date:   Tue Jul 29 15:37:52 2014 +0200

    Adapted ktp-proxy OTR interfaces.
---
 lib/channel-adapter.cpp   |  21 ++++++-
 lib/channel-adapter.h     |   1 +
 lib/chat-widget.cpp       |  17 ++++--
 lib/chat-widget.h         |   1 +
 lib/otr-channel-proxy.cpp |   1 +
 lib/otr-channel-proxy.h   | 150 +++++++++++++++++++++++++++++++++++++---------
 6 files changed, 157 insertions(+), 34 deletions(-)

diff --git a/lib/channel-adapter.cpp b/lib/channel-adapter.cpp
index 2fd7490..237dbaf 100644
--- a/lib/channel-adapter.cpp
+++ b/lib/channel-adapter.cpp
@@ -164,10 +164,14 @@ void ChannelAdapter::setupOTRChannel()
             SLOT(onPendingMessagesRemoved(const Tp::UIntList&)));
     connect(d->otrProxy.data(), SIGNAL(MessageSent(const Tp::MessagePartList&, uint, const QString&)),
             SLOT(onMessageSent(const Tp::MessagePartList&, uint, const QString&)));
+    connect(d->otrProxy.data(), SIGNAL(TrustLevelChanged(uint)), SLOT(onTrustLevelChanged(uint)));
 
     // initialize message queue;
     connect(d->otrProxy->requestPropertyPendingMessages(), SIGNAL(finished(Tp::PendingOperation*)),
                 SLOT(onPendingMessagesPropertyGet(Tp::PendingOperation*)));
+    // initialize trust level property
+    connect(d->otrProxy->requestPropertyTrustLevel(), SIGNAL(finished(Tp::PendingOperation*)),
+            SLOT(onTrustLevelPropertyGet(Tp::PendingOperation*)));
 }
 
 Tp::OTRTrustLevel ChannelAdapter::otrTrustLevel() const
@@ -177,7 +181,12 @@ Tp::OTRTrustLevel ChannelAdapter::otrTrustLevel() const
 
 void ChannelAdapter::onTrustLevelPropertyGet(Tp::PendingOperation *op)
 {
-
+    if(op->isError()) {
+        kWarning() << "Could not get property: TrustLevel";
+        return;
+    }
+    Tp::PendingVariant *pv = dynamic_cast<Tp::PendingVariant*>(op);
+    d->trustLevel = static_cast<Tp::OTRTrustLevel>(pv->result().toUInt(NULL));
 }
 
 bool ChannelAdapter::isOTRsuppored() const
@@ -188,11 +197,13 @@ bool ChannelAdapter::isOTRsuppored() const
 void ChannelAdapter::initializeOTR()
 {
     kDebug() << "Initializing OTR session";
+    d->otrProxy->Initialize();
 }
 
 void ChannelAdapter::stopOTR()
 {
     kDebug() << "Stopping OTR session";
+    d->otrProxy->Stop();
 }
 
 void ChannelAdapter::acknowledge(const QList<Tp::ReceivedMessage> &messages)
@@ -316,3 +327,11 @@ void ChannelAdapter::onMessageSent(const Tp::MessagePartList &content, uint flag
     OTRMessage message(content, d->textChannel);
     Q_EMIT messageSent(message, Tp::MessageSendingFlags(flags), messageToken);
 }
+
+void ChannelAdapter::onTrustLevelChanged(uint trustLevel)
+{
+    Tp::OTRTrustLevel oldLevel = d->trustLevel;
+    d->trustLevel = static_cast<Tp::OTRTrustLevel>(trustLevel);
+
+    Q_EMIT otrTrustLevelChanged(d->trustLevel, oldLevel);
+}
diff --git a/lib/channel-adapter.h b/lib/channel-adapter.h
index b7fbef2..33af748 100644
--- a/lib/channel-adapter.h
+++ b/lib/channel-adapter.h
@@ -73,6 +73,7 @@ class ChannelAdapter : public QObject
         void onMessageReceived(const Tp::MessagePartList &message);
         void onPendingMessagesRemoved(const Tp::UIntList &messageIDs);
         void onMessageSent(const Tp::MessagePartList &content, uint flags, const QString &messageToken);
+        void onTrustLevelChanged(uint trustLevel);
 
     Q_SIGNALS:
         void messageSent(const Tp::Message &message,
diff --git a/lib/chat-widget.cpp b/lib/chat-widget.cpp
index 8e8787e..5bb2280 100644
--- a/lib/chat-widget.cpp
+++ b/lib/chat-widget.cpp
@@ -681,6 +681,8 @@ void ChatWidget::setupOTR()
 {
     connect(&d->channel, SIGNAL(otrTrustLevelChanged(Tp::OTRTrustLevel, Tp::OTRTrustLevel)),
             SLOT(onOTRTrustLevelChanged(Tp::OTRTrustLevel, Tp::OTRTrustLevel)));
+    connect(&d->channel, SIGNAL(sessionRefreshed()),
+            SLOT(onOTRsessionRefreshed()));
 }
 
 void ChatWidget::onOTRTrustLevelChanged(Tp::OTRTrustLevel trustLevel, Tp::OTRTrustLevel previous)
@@ -713,6 +715,11 @@ void ChatWidget::onOTRTrustLevelChanged(Tp::OTRTrustLevel trustLevel, Tp::OTRTru
 
 }
 
+void ChatWidget::onOTRsessionRefreshed()
+{
+    d->ui.chatArea->addStatusMessage(i18n("Successfully refreshed OTR session"));
+}
+
 void ChatWidget::handleIncomingMessage(const Tp::ReceivedMessage &message, bool alreadyNotified)
 {
     kDebug() << title() << message.text();
@@ -1307,9 +1314,9 @@ void ChatWidget::currentPresenceChanged(const Tp::Presence &presence)
         d->ui.chatArea->addStatusMessage(i18n("You are now offline"), d->yourName);
         iconChanged(icon());
     } else {
-	if (d->ui.messageWidget && d->ui.messageWidget->isVisible()) {
-	    d->ui.messageWidget->animatedHide();
-	}
+        if (d->ui.messageWidget && d->ui.messageWidget->isVisible()) {
+            d->ui.messageWidget->animatedHide();
+        }
     }
 }
 
@@ -1360,7 +1367,7 @@ void ChatWidget::onMessageWidgetSwitchOnlineActionTriggered()
 void ChatWidget::onShareImageMenuActionTriggered()
 {
     if (!d->fileToTransferPath.isEmpty()) {
-	d->shareProvider->publish(d->fileToTransferPath);
+        d->shareProvider->publish(d->fileToTransferPath);
     }
 }
 
@@ -1378,7 +1385,7 @@ void ChatWidget::onShareProviderFinishedSuccess(ShareProvider* provider, const Q
 {
     Q_UNUSED(provider);
     if (!imageUrl.isEmpty()) {
-	d->channel.send(imageUrl);
+        d->channel.send(imageUrl);
     }
 }
 
diff --git a/lib/chat-widget.h b/lib/chat-widget.h
index 7dce061..b61d32c 100644
--- a/lib/chat-widget.h
+++ b/lib/chat-widget.h
@@ -230,6 +230,7 @@ private Q_SLOTS:
     void onShareProviderFinishedFailure(ShareProvider *provider, const QString &errorMessage);
     void onSendFileClicked();
     void onOTRTrustLevelChanged(Tp::OTRTrustLevel trustLevel, Tp::OTRTrustLevel previous);
+    void onOTRsessionRefreshed();
 
 private:
     /** connects necessary signals for the channel */
diff --git a/lib/otr-channel-proxy.cpp b/lib/otr-channel-proxy.cpp
index 8ab01c4..7f96223 100644
--- a/lib/otr-channel-proxy.cpp
+++ b/lib/otr-channel-proxy.cpp
@@ -38,6 +38,7 @@ void ChannelProxyInterfaceOTRInterface::invalidate(Tp::DBusProxy *proxy,
     disconnect(this, SIGNAL(MessageReceived(const Tp::MessagePartList&)), NULL, NULL);
     disconnect(this, SIGNAL(PendingMessagesRemoved(const Tp::UIntList&)), NULL, NULL);
     disconnect(this, SIGNAL(SessionRefreshed()), NULL, NULL);
+    disconnect(this, SIGNAL(TrustLevelChanged(uint)), NULL, NULL);
 
     Tp::AbstractInterface::invalidate(proxy, error, message);
 }
diff --git a/lib/otr-channel-proxy.h b/lib/otr-channel-proxy.h
index c373d6f..df08d81 100644
--- a/lib/otr-channel-proxy.h
+++ b/lib/otr-channel-proxy.h
@@ -113,7 +113,7 @@ public:
     /**
      * Asynchronous getter for the remote object property 
-- 
ktp-text-ui packaging



More information about the pkg-kde-commits mailing list