2023-02-22 01:48:49 +03:00
|
|
|
// SPDX-FileCopyrightText: Nheko Contributors
|
2021-03-05 02:35:15 +03:00
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2019-12-27 23:49:55 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <QDateTime>
|
|
|
|
#include <QString>
|
|
|
|
|
2023-10-31 18:38:15 +03:00
|
|
|
#include <mtx/common.hpp>
|
|
|
|
#include <mtx/events.hpp>
|
|
|
|
|
|
|
|
namespace mtx::events::collections {
|
|
|
|
struct TimelineEvents;
|
|
|
|
struct StateEvents;
|
|
|
|
}
|
2019-12-27 23:49:55 +03:00
|
|
|
|
|
|
|
namespace mtx::accessors {
|
2021-12-29 09:02:32 +03:00
|
|
|
const std::string &
|
2019-12-27 23:49:55 +03:00
|
|
|
event_id(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
|
2021-12-29 09:02:32 +03:00
|
|
|
const std::string &
|
2019-12-27 23:49:55 +03:00
|
|
|
room_id(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
|
2021-12-29 09:02:32 +03:00
|
|
|
const std::string &
|
2019-12-27 23:49:55 +03:00
|
|
|
sender(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
|
2023-10-31 02:47:12 +03:00
|
|
|
bool
|
|
|
|
is_state_event(const mtx::events::collections::StateEvents &event);
|
2021-02-01 00:41:43 +03:00
|
|
|
bool
|
|
|
|
is_state_event(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
|
2019-12-27 23:49:55 +03:00
|
|
|
QDateTime
|
|
|
|
origin_server_ts(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
|
2023-10-31 02:47:12 +03:00
|
|
|
std::uint64_t
|
|
|
|
origin_server_ts_ms(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
|
2019-12-27 23:49:55 +03:00
|
|
|
std::string
|
|
|
|
filename(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
|
2023-10-31 02:47:12 +03:00
|
|
|
mtx::events::EventType
|
|
|
|
event_type(const mtx::events::collections::TimelineEvents &event);
|
2019-12-27 23:49:55 +03:00
|
|
|
mtx::events::MessageType
|
|
|
|
msg_type(const mtx::events::collections::TimelineEvents &event);
|
2023-10-31 02:47:12 +03:00
|
|
|
bool
|
|
|
|
is_message(const mtx::events::collections::TimelineEvents &event);
|
2019-12-27 23:49:55 +03:00
|
|
|
std::string
|
|
|
|
room_name(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
std::string
|
|
|
|
room_topic(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
|
2020-07-24 20:30:12 +03:00
|
|
|
std::string
|
|
|
|
call_type(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
|
2019-12-27 23:49:55 +03:00
|
|
|
std::string
|
|
|
|
body(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
|
|
|
|
std::string
|
|
|
|
formatted_body(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
|
|
|
|
QString
|
|
|
|
formattedBodyWithFallback(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
|
|
|
|
std::optional<mtx::crypto::EncryptedFile>
|
|
|
|
file(const mtx::events::collections::TimelineEvents &event);
|
2022-03-21 07:49:12 +03:00
|
|
|
std::optional<mtx::crypto::EncryptedFile>
|
|
|
|
thumbnail_file(const mtx::events::collections::TimelineEvents &event);
|
2019-12-27 23:49:55 +03:00
|
|
|
|
|
|
|
std::string
|
|
|
|
url(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
std::string
|
|
|
|
thumbnail_url(const mtx::events::collections::TimelineEvents &event);
|
2022-03-21 02:48:27 +03:00
|
|
|
uint64_t
|
|
|
|
duration(const mtx::events::collections::TimelineEvents &event);
|
2019-12-27 23:49:55 +03:00
|
|
|
std::string
|
2020-03-01 21:55:43 +03:00
|
|
|
blurhash(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
std::string
|
2019-12-27 23:49:55 +03:00
|
|
|
mimetype(const mtx::events::collections::TimelineEvents &event);
|
2021-12-29 09:02:32 +03:00
|
|
|
const mtx::common::Relations &
|
2021-01-27 00:36:35 +03:00
|
|
|
relations(const mtx::events::collections::TimelineEvents &event);
|
2024-03-08 20:43:59 +03:00
|
|
|
std::optional<mtx::common::Mentions>
|
|
|
|
mentions(const mtx::events::collections::TimelineEvents &event);
|
2021-01-27 18:14:03 +03:00
|
|
|
void
|
|
|
|
set_relations(mtx::events::collections::TimelineEvents &event, mtx::common::Relations relations);
|
2020-07-20 01:42:48 +03:00
|
|
|
std::string
|
2020-02-16 02:20:41 +03:00
|
|
|
transaction_id(const mtx::events::collections::TimelineEvents &event);
|
2019-12-27 23:49:55 +03:00
|
|
|
|
|
|
|
int64_t
|
|
|
|
filesize(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
|
|
|
|
uint64_t
|
|
|
|
media_height(const mtx::events::collections::TimelineEvents &event);
|
|
|
|
|
|
|
|
uint64_t
|
|
|
|
media_width(const mtx::events::collections::TimelineEvents &event);
|
2020-05-30 17:37:51 +03:00
|
|
|
|
|
|
|
nlohmann::json
|
|
|
|
serialize_event(const mtx::events::collections::TimelineEvents &event);
|
2019-12-27 23:49:55 +03:00
|
|
|
}
|