[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:06:44 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=f3a30eb
The following commit has been merged in the master branch:
commit f3a30eb36e174a38ca95fd1b7d2ea6a6c17fa281
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Tue Apr 9 14:40:49 2013 +0200
Make sure ConversationModel never close a channels it is not handling
BUG: 293637
BUG: 317850
REVIEW: 109925
---
KTp/Declarative/conversation.cpp | 11 ++++++++++-
KTp/Declarative/conversations-model.cpp | 3 +--
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/KTp/Declarative/conversation.cpp b/KTp/Declarative/conversation.cpp
index 3975e00..6820913 100644
--- a/KTp/Declarative/conversation.cpp
+++ b/KTp/Declarative/conversation.cpp
@@ -31,6 +31,9 @@ class Conversation::ConversationPrivate
public:
MessagesModel *messages;
ConversationTarget *target;
+ //stores if the conversation has been delegated to another client and we are only observing the channel
+ //and not handling it.
+ bool delegated;
bool valid;
Tp::AccountPtr account;
};
@@ -51,6 +54,8 @@ Conversation::Conversation(const Tp::TextChannelPtr &channel,
d->target = new ConversationTarget(account, KTp::ContactPtr::qObjectCast(channel->targetContact()), this);
d->valid = channel->isValid();
+ d->delegated = false;
+
connect(channel.data(), SIGNAL(invalidated(Tp::DBusProxy*,QString,QString)),
SLOT(onChannelInvalidated(Tp::DBusProxy*,QString,QString)));
}
@@ -88,13 +93,17 @@ void Conversation::onChannelInvalidated(Tp::DBusProxy *proxy, const QString &err
void Conversation::delegateToProperClient()
{
ChannelDelegator::delegateChannel(d->account, d->messages->textChannel());
+ d->delegated = true;
Q_EMIT conversationDelegated();
}
void Conversation::requestClose()
{
kDebug();
- d->messages->textChannel()->requestClose();
+ //if we are not handling the channel do nothing.
+ if (!d->delegated) {
+ d->messages->textChannel()->requestClose();
+ }
}
Conversation::~Conversation()
diff --git a/KTp/Declarative/conversations-model.cpp b/KTp/Declarative/conversations-model.cpp
index c713ce7..5824d75 100644
--- a/KTp/Declarative/conversations-model.cpp
+++ b/KTp/Declarative/conversations-model.cpp
@@ -21,7 +21,6 @@
#include "conversation.h"
#include "conversation-target.h"
#include "messages-model.h"
-#include "channel-delegator.h"
#include <KDebug>
@@ -121,7 +120,7 @@ void ConversationsModel::handleChannels(const Tp::MethodInvocationContextPtr<> &
convo->messages()->setTextChannel(textChannel);
} else {
if (convo->messages()->textChannel() == textChannel) {
- ChannelDelegator::delegateChannel(account, textChannel, userActionTime);
+ convo->delegateToProperClient();
}
}
handled = true;
--
ktp-common-internals packaging
More information about the pkg-kde-commits
mailing list