Skip to content
Snippets Groups Projects
Commit 5db4d29b authored by Sébastien Blin's avatar Sébastien Blin
Browse files

messageadapter: fix types filtering

Some types where missing, causing the chatview to not show all
messages.

Change-Id: I2ac1dfa03de8330b38f2828e66eead7114b2cfe6
parent 88d6de83
No related branches found
No related tags found
No related merge requests found
...@@ -43,7 +43,8 @@ public: ...@@ -43,7 +43,8 @@ public:
auto type = static_cast<interaction::Type>( auto type = static_cast<interaction::Type>(
sourceModel()->data(index, MessageList::Role::Type).toInt()); sourceModel()->data(index, MessageList::Role::Type).toInt());
return type != interaction::Type::MERGE && type != interaction::Type::EDITED 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 bool lessThan(const QModelIndex& left, const QModelIndex& right) const override
{ {
......
...@@ -42,6 +42,8 @@ enum class Type { ...@@ -42,6 +42,8 @@ enum class Type {
MERGE, MERGE,
EDITED, EDITED,
REACTION, REACTION,
VOTE,
UPDATE_PROFILE,
COUNT__ COUNT__
}; };
Q_ENUM_NS(Type) Q_ENUM_NS(Type)
...@@ -62,6 +64,10 @@ to_string(const Type& type) ...@@ -62,6 +64,10 @@ to_string(const Type& type)
return "DATA_TRANSFER"; return "DATA_TRANSFER";
case Type::MERGE: case Type::MERGE:
return "MERGE"; return "MERGE";
case Type::VOTE:
return "VOTE";
case Type::UPDATE_PROFILE:
return "UPDATE_PROFILE";
case Type::EDITED: case Type::EDITED:
return "EDITED"; return "EDITED";
case Type::REACTION: case Type::REACTION:
...@@ -90,6 +96,10 @@ to_type(const QString& type) ...@@ -90,6 +96,10 @@ to_type(const QString& type)
return interaction::Type::DATA_TRANSFER; return interaction::Type::DATA_TRANSFER;
else if (type == "merge") else if (type == "merge")
return interaction::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") else if (type == "application/edited-message")
return interaction::Type::EDITED; return interaction::Type::EDITED;
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment