Move the function to get a subtitle string to eventhandler

This commit is contained in:
James Graham
2023-12-10 13:19:13 +00:00
parent 4751ac6acc
commit 8d717b78ac
7 changed files with 43 additions and 44 deletions

View File

@@ -645,6 +645,15 @@ QString EventHandler::getGenericBody() const
i18n("Unknown event"));
}
QString EventHandler::subtitleText() const
{
if (m_event == nullptr) {
qCWarning(EventHandling) << "subtitleText called with m_event set to nullptr.";
return {};
}
return singleLineAuthorDisplayname() + (m_event->isStateEvent() ? QLatin1String(" ") : QLatin1String(": ")) + getPlainBody(true);
}
QVariantMap EventHandler::getMediaInfo() const
{
if (m_room == nullptr) {