Make notifications more useful
- Refactor and cleanup code - Don't paginate through notifications - it spams the server with requests and realistically only contains anything relevant on startup after a long time, in which case you're going to lose some notification anyway - Only show newest notification for the respective room, closing the old notification if one exists - Only show text of this notification BUG: 475228
This commit is contained in:
@@ -47,8 +47,13 @@ public:
|
||||
/**
|
||||
* @brief Display a native notification for an message.
|
||||
*/
|
||||
Q_INVOKABLE void
|
||||
postNotification(NeoChatRoom *room, const QString &sender, const QString &text, const QImage &icon, const QString &replyEventId, bool canReply);
|
||||
Q_INVOKABLE void postNotification(NeoChatRoom *room,
|
||||
const QString &sender,
|
||||
const QString &text,
|
||||
const QImage &icon,
|
||||
const QString &replyEventId,
|
||||
bool canReply,
|
||||
qint64 timestamp);
|
||||
|
||||
/**
|
||||
* @brief Display a native notification for an invite.
|
||||
@@ -82,7 +87,7 @@ private:
|
||||
|
||||
bool shouldPostNotification(QPointer<NeoChatConnection> connection, const QJsonValue ¬ification);
|
||||
|
||||
QHash<QString, KNotification *> m_notifications;
|
||||
QHash<QString, std::pair<qint64, KNotification *>> m_notifications;
|
||||
QHash<QString, QPointer<KNotification>> m_invitations;
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
Reference in New Issue
Block a user