aboutsummaryrefslogtreecommitdiff
path: root/lib/events/stickerevent.cpp
blob: 6d318f0e2edd34d46af205822dd4331581e9472b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// SDPX-FileCopyrightText: 2020 Carl Schwan <carlschwan@kde.org>
// SPDX-License-Identifier: LGPL-2.1-or-later

#include "stickerevent.h"

using namespace Quotient;

StickerEvent::StickerEvent(const QJsonObject &obj)
    : RoomEvent(typeId(), obj)
    , m_imageContent(EventContent::ImageContent(obj["content"_ls].toObject()))
{}

QString StickerEvent::body() const
{
    return contentPart<QString>("body"_ls);
}

const EventContent::ImageContent &StickerEvent::image() const
{
    return m_imageContent;
}

QUrl StickerEvent::url() const
{
    return m_imageContent.url();
}