aboutsummaryrefslogtreecommitdiff
path: root/lib/events/redactionevent.h
blob: be20bf5225bc54fdf689480561ead2461b1a41ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// SPDX-FileCopyrightText: 2017 Kitsune Ral <kitsune-ral@users.sf.net>
// SPDX-License-Identifier: LGPL-2.1-or-later

#pragma once

#include "roomevent.h"

namespace Quotient {
class RedactionEvent : public RoomEvent {
public:
    DEFINE_EVENT_TYPEID("m.room.redaction", RedactionEvent)

    explicit RedactionEvent(const QJsonObject& obj) : RoomEvent(typeId(), obj)
    {}

    QString redactedEvent() const
    {
        return fullJson()["redacts"_ls].toString();
    }
    QString reason() const { return contentPart<QString>("reason"_ls); }
};
REGISTER_EVENT_TYPE(RedactionEvent)
} // namespace Quotient