Implement viewing and responding to polls

This commit is contained in:
Tobias Fella
2022-10-20 01:22:49 +02:00
parent 425f2a4b85
commit 0e782c4a93
14 changed files with 427 additions and 3 deletions

View File

@@ -13,6 +13,9 @@
#include <events/simplestateevents.h>
#include <user.h>
#ifdef QUOTIENT_07
#include "pollevent.h"
#endif
#include "stickerevent.h"
#include <QDebug>
@@ -496,6 +499,15 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
if (is<const EncryptedEvent>(evt)) {
return DelegateType::Encrypted;
}
#ifdef QUOTIENT_07
if (is<PollStartEvent>(evt)) {
if (evt.isRedacted()) {
return DelegateType::Message;
}
return DelegateType::Poll;
}
#endif
return DelegateType::Other;
}
@@ -532,6 +544,7 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const
if (auto e = eventCast<const StickerEvent>(&evt)) {
return QVariant::fromValue(e->image().originalJson);
}
return evt.contentJson();
}
if (role == HighlightRole) {