Skip to content

Commit

Permalink
Cleanup, mostly of things deprecated in lib 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
KitsuneRal committed Jan 6, 2023
1 parent 9bdb5a2 commit 0315b39
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion client/htmlfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ Processor::rewrite_t Processor::filterTag(QStringView tag,
|| (tag == u"img" && aName == u"src" && aValue.startsWith(u"mxc:"))
|| find(passList.begin(), passList.end(), a.qualifiedName())
!= passList.end())
rewrite.front().second.push_back(move(a));
rewrite.front().second.push_back(std::move(a));
} // for (a: attributes)

// Remove the original <font> or <span> if they end up without attributes
Expand Down
10 changes: 5 additions & 5 deletions client/models/messageeventmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,8 +819,8 @@ QVariant MessageEventModel::data(const QModelIndex& idx, int role) const
return settings.get<bool>("UI/show_redacted")
? EventStatus::Redacted : EventStatus::Hidden;

if (evt.isStateEvent()
&& static_cast<const StateEventBase&>(evt).repeatsState()
if (auto* stateEvt = eventCast<const StateEvent>(&evt);
stateEvt && stateEvt->repeatsState()
&& !settings.get<bool>("UI/show_noop_events"))
return EventStatus::Hidden;

Expand Down Expand Up @@ -855,15 +855,15 @@ QVariant MessageEventModel::data(const QModelIndex& idx, int role) const
std::vector<Reaction> reactions; // using vector to maintain the order
// XXX: Should the list be ordered by the number of reactions instead?
const auto& annotations =
m_currentRoom->relatedEvents(evt, EventRelation::Annotation());
m_currentRoom->relatedEvents(evt, EventRelation::AnnotationType);
for (const auto& a: annotations)
if (const auto e = eventCast<const ReactionEvent>(a)) {
auto rIt = std::find_if(reactions.begin(), reactions.end(),
[&e] (const Reaction& r) {
return r.key == e->relation().key;
return r.key == e->key();
});
if (rIt == reactions.end())
rIt = reactions.insert(reactions.end(), {e->relation().key});
rIt = reactions.insert(reactions.end(), { e->key() });

rIt->authorsList << m_currentRoom->safeMemberName(e->senderId());
rIt->includesLocalUser |=
Expand Down
2 changes: 1 addition & 1 deletion client/timelinewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void TimelineWidget::reactionButtonClicked(const QString& eventId,

for (const auto& a: annotations)
if (auto* e = eventCast<const ReactionEvent>(a);
e != nullptr && e->relation().key == key
e != nullptr && e->key() == key
&& a->senderId() == currentRoom()->localUser()->id()) //
{
currentRoom()->redactEvent(a->id());
Expand Down

0 comments on commit 0315b39

Please sign in to comment.