Commit 953a4d52 authored by David Edmundson's avatar David Edmundson

Only try to replace TextChannel in setTextChannel if it has actually changed

Reviewed-by: Aleix Pol
BUG: 321115
Fixed-in: 0.7.0
parent 1e664e47
......@@ -69,11 +69,13 @@ Conversation::Conversation(QObject *parent) : QObject(parent)
void Conversation::setTextChannel(const Tp::TextChannelPtr& channel)
{
d->messages->setTextChannel(channel);
d->valid = channel->isValid();
connect(channel.data(), SIGNAL(invalidated(Tp::DBusProxy*,QString,QString)),
SLOT(onChannelInvalidated(Tp::DBusProxy*,QString,QString)));
Q_EMIT validityChanged(d->valid);
if (d->messages->textChannel() != channel) {
d->messages->setTextChannel(channel);
d->valid = channel->isValid();
connect(channel.data(), SIGNAL(invalidated(Tp::DBusProxy*,QString,QString)),
SLOT(onChannelInvalidated(Tp::DBusProxy*,QString,QString)));
Q_EMIT validityChanged(d->valid);
}
}
Tp::TextChannelPtr Conversation::textChannel() const
......
......@@ -89,6 +89,7 @@ void MessagesModel::setupChannelSignals(const Tp::TextChannelPtr &channel)
void MessagesModel::setTextChannel(Tp::TextChannelPtr channel)
{
Q_ASSERT(channel != d->textChannel);
kDebug();
setupChannelSignals(channel);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment