mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 12:38:48 +03:00
Make CI happy
This commit is contained in:
parent
21562eed75
commit
1408b1a97d
2 changed files with 15 additions and 19 deletions
|
@ -16,8 +16,8 @@
|
|||
|
||||
#include <variant>
|
||||
|
||||
QString
|
||||
NotificationsManager::formatNotification(const mtx::responses::Notification ¬ification)
|
||||
static QString
|
||||
formatNotification(const mtx::responses::Notification ¬ification)
|
||||
{
|
||||
return utils::stripReplyFallbacks(notification.event, {}, {}).quoted_body;
|
||||
}
|
||||
|
|
|
@ -60,11 +60,23 @@ NotificationsManager::postNotification(const mtx::responses::Notification ¬if
|
|||
¬ification.event) != nullptr;
|
||||
const auto isReply = utils::isReply(notification.event);
|
||||
|
||||
auto formatNotification = [this, notification, sender] {
|
||||
const auto template_ = getMessageTemplate(notification);
|
||||
if (std::holds_alternative<
|
||||
mtx::events::EncryptedEvent<mtx::events::msg::Encrypted>>(
|
||||
notification.event)) {
|
||||
return template_;
|
||||
}
|
||||
|
||||
return template_.arg(
|
||||
utils::stripReplyFallbacks(notification.event, {}, {}).quoted_body);
|
||||
};
|
||||
|
||||
const auto line1 =
|
||||
(room_name == sender) ? sender : QString("%1 - %2").arg(sender).arg(room_name);
|
||||
const auto line2 = (isEncrypted ? (isReply ? tr("%1 replied with an encrypted message")
|
||||
: tr("%1 sent an encrypted message"))
|
||||
: formatNotification(notification));
|
||||
: formatNotification());
|
||||
|
||||
auto iconPath = QStandardPaths::writableLocation(QStandardPaths::CacheLocation) +
|
||||
room_name + "-room-avatar.png";
|
||||
|
@ -100,19 +112,3 @@ void NotificationsManager::notificationClosed(uint, uint) {}
|
|||
void
|
||||
NotificationsManager::removeNotification(const QString &, const QString &)
|
||||
{}
|
||||
|
||||
QString
|
||||
NotificationsManager::formatNotification(const mtx::responses::Notification ¬ification)
|
||||
{
|
||||
const auto sender =
|
||||
cache::displayName(QString::fromStdString(notification.room_id),
|
||||
QString::fromStdString(mtx::accessors::sender(notification.event)));
|
||||
|
||||
const auto template_ = getMessageTemplate(notification);
|
||||
if (std::holds_alternative<mtx::events::EncryptedEvent<mtx::events::msg::Encrypted>>(
|
||||
notification.event)) {
|
||||
return template_;
|
||||
}
|
||||
|
||||
return template_.arg(utils::stripReplyFallbacks(notification.event, {}, {}).quoted_body);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue