aboutsummaryrefslogtreecommitdiff
path: root/lib/events/roommessageevent.cpp
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-07-31 17:33:31 +0900
committerGitHub <noreply@github.com>2019-07-31 17:33:31 +0900
commitf5083ee71e6fad9f28c4b835899f3ad574b426f1 (patch)
tree32039492751db53d89188a403f112e6c3e068af4 /lib/events/roommessageevent.cpp
parent0df1cdcf40fd639f039f0c0e7165c8c40f6efd79 (diff)
parent2737dc00334ad3a56c1b311435dbe84453ee389e (diff)
downloadlibquotient-f5083ee71e6fad9f28c4b835899f3ad574b426f1.tar.gz
libquotient-f5083ee71e6fad9f28c4b835899f3ad574b426f1.zip
Merge pull request #335 from quotient-im/aa13q-e2ee-encrypted-msg
E2EE: introduce EncryptedEvent
Diffstat (limited to 'lib/events/roommessageevent.cpp')
-rw-r--r--lib/events/roommessageevent.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/events/roommessageevent.cpp b/lib/events/roommessageevent.cpp
index 8f4e0ebc..ec18e962 100644
--- a/lib/events/roommessageevent.cpp
+++ b/lib/events/roommessageevent.cpp
@@ -32,7 +32,6 @@ using MsgType = RoomMessageEvent::MsgType;
static const auto RelatesToKey = "m.relates_to"_ls;
static const auto MsgTypeKey = "msgtype"_ls;
-static const auto BodyKey = "body"_ls;
static const auto FormattedBodyKey = "formatted_body"_ls;
static const auto TextTypeKey = "m.text";
@@ -159,7 +158,7 @@ RoomMessageEvent::RoomMessageEvent(const QJsonObject& obj)
if (isRedacted())
return;
const QJsonObject content = contentJson();
- if ( content.contains(MsgTypeKey) && content.contains(BodyKey) )
+ if ( content.contains(MsgTypeKey) && content.contains(BodyKeyL) )
{
auto msgtype = content[MsgTypeKey].toString();
bool msgTypeFound = false;
@@ -196,7 +195,7 @@ QString RoomMessageEvent::rawMsgtype() const
QString RoomMessageEvent::plainBody() const
{
- return contentJson()[BodyKey].toString();
+ return contentJson()[BodyKeyL].toString();
}
QMimeType RoomMessageEvent::mimeType() const
@@ -267,7 +266,7 @@ TextContent::TextContent(const QJsonObject& json)
// Falling back to plain text, as there's no standard way to describe
// rich text in messages.
mimeType = PlainTextMimeType;
- body = json[BodyKey].toString();
+ body = json[BodyKeyL].toString();
}
const auto replyJson = json[RelatesToKey].toObject()
.value(RelatesTo::ReplyTypeId()).toObject();