Enable ending polls
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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. */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user