- return new MatrixEvent(lager::with(m_timelineEventIds, m_messagesMap, m_localEchoes, LAGER_QT(count))
- .map([index](const auto &tlEventIds, const auto &messagesMap, const auto &localEchoes, const auto &count) -> std::variant<Kazv::Event, Kazv::LocalEchoDesc, std::string> {
+ return new MatrixEvent(lager::with(m_timelineEventIds, m_messagesMap, m_localEchoes)
+ .map([index](const auto &tlEventIds, const auto &messagesMap, const auto &localEchoes) -> std::variant<Kazv::Event, Kazv::LocalEchoDesc, std::string> {
+ auto count = tlEventIds.size() + localEchoes.size();
auto rIndex = count - index - 1;
if (static_cast<unsigned int>(rIndex) < tlEventIds.size()) {
auto eventId = tlEventIds[rIndex];
// For some timelines like pinned events, the message may not be available
if (messagesMap.count(eventId)) {
return messagesMap[eventId];
} else {
return eventId;
}
} else {
auto remainingIndex = rIndex - tlEventIds.size();
if (remainingIndex < localEchoes.size()) {
return localEchoes[remainingIndex];
} else {
return Event();
}
}
}), m_room);
}
+QVariant MatrixRoomTimeline::data(const QModelIndex &index, int role) const
+{
+ if (!index.isValid() || std::size_t(index.row()) >= static_cast<const EnhancedTotalItems &>(m_innerTotalItems).size()) {
compare(showPassiveNotification.lastArgs()[0], l10n.get('event-pin-failed-prompt', { errorCode: 'M_FORBIDDEN', errorMsg: 'You are not allowed to do so' }));
compare(showPassiveNotification.lastArgs()[0], l10n.get('event-unpin-failed-prompt', { errorCode: 'M_FORBIDDEN', errorMsg: 'You are not allowed to do so' }));