2018-01-04 23:27:32 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "RoomInfoListItem.h"
|
|
|
|
|
|
|
|
#include <QDateTime>
|
|
|
|
#include <mtx/events/collections.hpp>
|
|
|
|
|
|
|
|
namespace utils {
|
|
|
|
|
|
|
|
using TimelineEvent = mtx::events::collections::TimelineEvents;
|
|
|
|
|
|
|
|
//! Human friendly timestamp representation.
|
|
|
|
QString
|
|
|
|
descriptiveTime(const QDateTime &then);
|
|
|
|
|
|
|
|
//! Generate a message description from the event to be displayed
|
|
|
|
//! in the RoomList.
|
|
|
|
DescInfo
|
|
|
|
getMessageDescription(const TimelineEvent &event, const QString &localUser);
|
2018-01-12 09:21:53 +01:00
|
|
|
|
|
|
|
//! Get the first character of a string, taking into account that
|
|
|
|
//! surrogate pairs might be in use.
|
|
|
|
QString
|
|
|
|
firstChar(const QString &input);
|
2018-02-18 21:52:31 +01:00
|
|
|
|
|
|
|
//! Get a human readable file size with the appropriate units attached.
|
|
|
|
QString
|
2018-02-19 21:09:21 +01:00
|
|
|
humanReadableFileSize(uint64_t bytes);
|
2018-01-04 23:27:32 +01:00
|
|
|
}
|