From 533c5a8767adeb7de0a554eb6aa0335148a1403f Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Sun, 30 May 2021 16:23:14 +0200 Subject: [PATCH 1/1] 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. --- src/client/messagefilter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.20.1