analyzer: subst: "%CLIENT_RELEASE_LABEL%": r0 "%CLIENT_MAJOR_VERSION%": r0 identifiers: signed: signedData unsigned: unsignedData PushRule/default: isDefault default: defaultVersion # getCapabilities/RoomVersionsCapability origin_server_ts: originServerTimestamp # Instead of originServerTs start: begin # Because start() is a method in BaseJob m.upload.size: uploadSize m.homeserver: homeserver m.identity_server: identityServer m.change_password: changePassword m.room_versions: roomVersions AuthenticationData/additionalProperties: authInfo /^/(Location|Protocol|User)$/: 'ThirdParty$1' # Change some response names /requestTokenTo.*/user: "" login>/medium: "" login>/address: "" # Structure inside `types`: # - swaggerType: # OR # - swaggerType: # - swaggerFormat: # - /swaggerFormatRegEx/: # - //: # default, if the format doesn't mach anything above # WHERE # targetTypeSpec = targetType OR # { type: targetType, imports: , } # swaggerType can be +set/+on pair; attributes from the map under +set # are added to each type from the sequence under +on. types: - +set: &UseOmittable useOmittable: omittedValue: 'none' # Quotient::none in lib/util.h +on: - integer: - int64: qint64 - int32: qint32 - //: int - number: - float: float - //: double - boolean: bool - string: - byte: &ByteStream type: QIODevice* imports: - binary: *ByteStream - +set: { avoidCopy: } +on: - date: type: QDate initializer: QDate::fromString("{{defaultValue}}") - dateTime: type: QDateTime initializer: QDateTime::fromString("{{defaultValue}}") - uri: type: QUrl initializer: QUrl::fromEncoded("{{defaultValue}}") - //: &QString type: QString initializer: QStringLiteral("{{defaultValue}}") isString: - file: *ByteStream - +set: { avoidCopy: } +on: - object: &QJsonObject { type: QJsonObject } - $ref: - +set: moveOnly: imports: '"events/eventloader.h"' +on: - /state_event.yaml$/: StateEventPtr - /room_event.yaml$/: RoomEventPtr - /event.yaml$/: EventPtr - /m\.room\.member/: void # Skip resolving; see EventsArray<> below - +set: # This renderer actually applies to all $ref things _importRenderer: '"{{#segments}}{{_}}{{#_join}}/{{/_join}}{{/segments}}.h"' +on: - '/^(\./)?definitions/request_email_validation.yaml$/': title: EmailValidationData - '/^(\./)?definitions/request_msisdn_validation.yaml$/': title: MsisdnValidationData - /_filter.yaml$/: # Event/RoomEventFilters do NOT need Omittable<> - /public_rooms_response.yaml$/: { _inline: true } - //: *UseOmittable # Also apply "avoidCopy" to all other ref'ed types - schema: - getTurnServer<: *QJsonObject # It's used as an opaque JSON object - PublicRoomResponse: { _inline: true } # - defineFilter>: &Filter # Force folding into a structure # type: Filter # imports: '"csapi/definitions/sync_filter.h"' # - getFilter<: *Filter - RoomFilter: # A structure inside Filter, same story as with *_filter.yaml - //: *UseOmittable - array: -
// 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 content<QString>("body"_ls);
}

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

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