diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/events/roommessageevent.cpp | 9 | ||||
-rw-r--r-- | lib/room.cpp | 5 |
2 files changed, 9 insertions, 5 deletions
diff --git a/lib/events/roommessageevent.cpp b/lib/events/roommessageevent.cpp index 14824277..a9d9754f 100644 --- a/lib/events/roommessageevent.cpp +++ b/lib/events/roommessageevent.cpp @@ -325,12 +325,15 @@ void TextContent::fillJson(QJsonObject* json) const } if (relatesTo) { json->insert(QStringLiteral("m.relates_to"), - QJsonObject { { "rel_type", relatesTo->type }, { EventIdKey, relatesTo->eventId } }); + relatesTo->type == RelatesTo::ReplyTypeId() ? + QJsonObject { { relatesTo->type, QJsonObject{ { EventIdKey, relatesTo->eventId } } } } : + QJsonObject { { "rel_type", relatesTo->type }, { EventIdKey, relatesTo->eventId } } + ); if (relatesTo->type == RelatesTo::ReplacementTypeId()) { QJsonObject newContentJson; if (mimeType.inherits("text/html")) { - json->insert(FormatKey, HtmlContentTypeId); - json->insert(FormattedBodyKey, body); + newContentJson.insert(FormatKey, HtmlContentTypeId); + newContentJson.insert(FormattedBodyKey, body); } json->insert(QStringLiteral("m.new_content"), newContentJson); } diff --git a/lib/room.cpp b/lib/room.cpp index 2e8641aa..fadcea17 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -1404,8 +1404,9 @@ void Room::Private::removeMemberFromMap(User* u) if (et.nsecsElapsed() > profilerMinNsecs() / 10) qCDebug(MEMBERS) << "...done in" << et; if (it != membersMap.cend()) { - Q_ASSERT_X(false, __FUNCTION__, - "Mismatched name in the room members list"); + // The assert (still) does more harm than good, it seems +// Q_ASSERT_X(false, __FUNCTION__, +// "Mismatched name in the room members list"); qCCritical(MEMBERS) << "Mismatched name in the room members list;" " avoiding the list corruption"; membersMap.remove(it.key(), u); |