From: Manuel Nickschas Date: Sun, 30 May 2021 14:23:14 +0000 (+0200) Subject: client: Fix an issue with redirection in MessageFilter X-Git-Tag: 0.14-rc2~18 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=533c5a8767adeb7de0a554eb6aa0335148a1403f;hp=4e51500401db3c85dbe5e92e5e5c15b6e3c87787 client: Fix an issue with redirection in MessageFilter Temporarily enabling the shadow warning unearthed an issue in 13 year old code. I'm not quite sure if this really caused problems in practice, but it clearly seems wrong to keep the invalid BufferId in the outer scope after fixing it in the inner scope, so fix it. --- diff --git a/src/client/messagefilter.cpp b/src/client/messagefilter.cpp index 6382aca5..b4082e68 100644 --- a/src/client/messagefilter.cpp +++ b/src/client/messagefilter.cpp @@ -185,7 +185,7 @@ bool MessageFilter::filterAcceptsRow(int sourceRow, const QModelIndex& sourcePar if (redirectionTarget & BufferSettings::CurrentBuffer && !(flags & Message::Backlog)) { BufferId redirectedTo = sourceModel()->data(sourceIdx, MessageModel::RedirectedToRole).value(); if (!redirectedTo.isValid()) { - BufferId redirectedTo = Client::bufferModel()->currentIndex().data(NetworkModel::BufferIdRole).value(); + redirectedTo = Client::bufferModel()->currentIndex().data(NetworkModel::BufferIdRole).value(); if (redirectedTo.isValid()) sourceModel()->setData(sourceIdx, QVariant::fromValue(redirectedTo), MessageModel::RedirectedToRole); }