From 5db4d29b73bb2a512b994e200b16be970a42eafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Blin?= <sebastien.blin@savoirfairelinux.com> Date: Fri, 3 Feb 2023 10:48:44 -0500 Subject: [PATCH] messageadapter: fix types filtering Some types where missing, causing the chatview to not show all messages. Change-Id: I2ac1dfa03de8330b38f2828e66eead7114b2cfe6 --- src/app/messagesadapter.h | 3 ++- src/libclient/api/interaction.h | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/app/messagesadapter.h b/src/app/messagesadapter.h index 881eec376..8913d89a2 100644 --- a/src/app/messagesadapter.h +++ b/src/app/messagesadapter.h @@ -43,7 +43,8 @@ public: auto type = static_cast<interaction::Type>( sourceModel()->data(index, MessageList::Role::Type).toInt()); return type != interaction::Type::MERGE && type != interaction::Type::EDITED - && type != interaction::Type::REACTION; + && type != interaction::Type::REACTION && type != interaction::Type::VOTE + && type != interaction::Type::UPDATE_PROFILE && type != interaction::Type::INVALID; }; bool lessThan(const QModelIndex& left, const QModelIndex& right) const override { diff --git a/src/libclient/api/interaction.h b/src/libclient/api/interaction.h index 237060465..3abfb2dfb 100644 --- a/src/libclient/api/interaction.h +++ b/src/libclient/api/interaction.h @@ -42,6 +42,8 @@ enum class Type { MERGE, EDITED, REACTION, + VOTE, + UPDATE_PROFILE, COUNT__ }; Q_ENUM_NS(Type) @@ -62,6 +64,10 @@ to_string(const Type& type) return "DATA_TRANSFER"; case Type::MERGE: return "MERGE"; + case Type::VOTE: + return "VOTE"; + case Type::UPDATE_PROFILE: + return "UPDATE_PROFILE"; case Type::EDITED: return "EDITED"; case Type::REACTION: @@ -90,6 +96,10 @@ to_type(const QString& type) return interaction::Type::DATA_TRANSFER; else if (type == "merge") return interaction::Type::MERGE; + else if (type == "application/update-profile") + return interaction::Type::UPDATE_PROFILE; + else if (type == "vote") + return interaction::Type::VOTE; else if (type == "application/edited-message") return interaction::Type::EDITED; else -- GitLab