Enable ending polls

This commit is contained in:
James Graham
2025-03-28 13:41:46 +00:00
parent fadb5725e0
commit 42fab806c6
9 changed files with 113 additions and 50 deletions

View File

@@ -238,6 +238,10 @@ QVariant MessageModel::data(const QModelIndex &idx, int role) const
return {};
}
if (role == IsPollRole) {
return event->get().is<PollStartEvent>();
}
if (role == ShowSectionRole) {
for (auto r = row + 1; r < rowCount(); ++r) {
auto i = index(r);
@@ -316,6 +320,7 @@ QHash<int, QByteArray> MessageModel::roleNames() const
roles[ProgressInfoRole] = "progressInfo";
roles[IsThreadedRole] = "isThreaded";
roles[ThreadRootRole] = "threadRoot";
roles[IsPollRole] = "isPoll";
roles[ShowSectionRole] = "showSection";
roles[ReadMarkersRole] = "readMarkers";
roles[ShowReadMarkersRole] = "showReadMarkers";

View File

@@ -72,6 +72,7 @@ public:
IsThreadedRole, /**< Whether the message is in a thread. */
ThreadRootRole, /**< The Matrix ID of the thread root message, if any . */
IsPollRole, /**< Whether the message is a poll. */
ShowSectionRole, /**< Whether the section header should be shown. */