Skip to content
Snippets Groups Projects
Verified Commit d8fb4d92 authored by Loren Burkholder's avatar Loren Burkholder Committed by Nicolas Werner
Browse files

Simplify message body construction

parent 4a86e14d
No related branches found
No related tags found
No related merge requests found
......@@ -16,14 +16,11 @@ NotificationsManager::postNotification(const mtx::responses::Notification &notif
const auto sender = cache::displayName(
room_id, QString::fromStdString(mtx::accessors::sender(notification.event)));
QString text;
if (mtx::accessors::msg_type(notification.event) == mtx::events::MessageType::Emote)
text =
formatNotification("* " + sender + " " +
mtx::accessors::formattedBodyWithFallback(notification.event));
else
text = formatNotification(
sender + ": " + mtx::accessors::formattedBodyWithFallback(notification.event));
QString text =
((mtx::accessors::msg_type(notification.event) == mtx::events::MessageType::Emote)
? "* " + sender + " "
: sender + ": ") +
formatNotification(mtx::accessors::formattedBodyWithFallback(notification.event));
systemPostNotification(room_id, event_id, room_name, sender, text, icon);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment