Simplify message body construction
This commit is contained in:
parent
4a86e14d04
commit
d8fb4d9292
@ -16,14 +16,11 @@ NotificationsManager::postNotification(const mtx::responses::Notification ¬if
|
|||||||
const auto sender = cache::displayName(
|
const auto sender = cache::displayName(
|
||||||
room_id, QString::fromStdString(mtx::accessors::sender(notification.event)));
|
room_id, QString::fromStdString(mtx::accessors::sender(notification.event)));
|
||||||
|
|
||||||
QString text;
|
QString text =
|
||||||
if (mtx::accessors::msg_type(notification.event) == mtx::events::MessageType::Emote)
|
((mtx::accessors::msg_type(notification.event) == mtx::events::MessageType::Emote)
|
||||||
text =
|
? "* " + sender + " "
|
||||||
formatNotification("* " + sender + " " +
|
: sender + ": ") +
|
||||||
mtx::accessors::formattedBodyWithFallback(notification.event));
|
formatNotification(mtx::accessors::formattedBodyWithFallback(notification.event));
|
||||||
else
|
|
||||||
text = formatNotification(
|
|
||||||
sender + ": " + mtx::accessors::formattedBodyWithFallback(notification.event));
|
|
||||||
|
|
||||||
systemPostNotification(room_id, event_id, room_name, sender, text, icon);
|
systemPostNotification(room_id, event_id, room_name, sender, text, icon);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user