#include "Utils.h" #include #include #include using TimelineEvent = mtx::events::collections::TimelineEvents; QString utils::descriptiveTime(const QDateTime &then) { const auto now = QDateTime::currentDateTime(); const auto days = then.daysTo(now); if (days == 0) return then.toString("HH:mm"); else if (days < 2) return QString("Yesterday"); else if (days < 365) return then.toString("dd/MM"); return then.toString("dd/MM/yy"); } DescInfo utils::getMessageDescription(const TimelineEvent &event, const QString &localUser, const QString &room_id) { using Audio = mtx::events::RoomEvent; using Emote = mtx::events::RoomEvent; using File = mtx::events::RoomEvent; using Image = mtx::events::RoomEvent; using Notice = mtx::events::RoomEvent; using Text = mtx::events::RoomEvent; using Video = mtx::events::RoomEvent; if (mpark::holds_alternative