Don't use raw json for getting reply event id

This commit is contained in:
Tobias Fella
2025-08-29 22:11:20 +02:00
parent 409b6da160
commit bbf2587908

View File

@@ -1675,7 +1675,11 @@ std::pair<const Quotient::RoomEvent *, bool> NeoChatRoom::getEvent(const QString
const RoomEvent *NeoChatRoom::getReplyForEvent(const RoomEvent &event) const
{
#if Quotient_VERSION_MINOR > 9
const QString &replyEventId = event.replyEventId(true);
#else
const QString &replyEventId = event.contentJson()["m.relates_to"_L1].toObject()["m.in_reply_to"_L1].toObject()["event_id"_L1].toString();
#endif
if (replyEventId.isEmpty()) {
return {};
};