Don't use raw json for getting reply event id
This commit is contained in:
@@ -1675,7 +1675,11 @@ std::pair<const Quotient::RoomEvent *, bool> NeoChatRoom::getEvent(const QString
|
|||||||
|
|
||||||
const RoomEvent *NeoChatRoom::getReplyForEvent(const RoomEvent &event) const
|
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();
|
const QString &replyEventId = event.contentJson()["m.relates_to"_L1].toObject()["m.in_reply_to"_L1].toObject()["event_id"_L1].toString();
|
||||||
|
#endif
|
||||||
if (replyEventId.isEmpty()) {
|
if (replyEventId.isEmpty()) {
|
||||||
return {};
|
return {};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user