2020-01-13 16:35:58 +03:00
|
|
|
#ifndef NOTIFICATIONHANDLER_H
|
|
|
|
#define NOTIFICATIONHANDLER_H
|
|
|
|
|
|
|
|
#include <QtCore>
|
|
|
|
|
|
|
|
#include "UserModel.h"
|
|
|
|
|
|
|
|
class QJsonDocument;
|
|
|
|
|
|
|
|
namespace OCC {
|
|
|
|
|
|
|
|
class ServerNotificationHandler : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit ServerNotificationHandler(AccountState *accountState, QObject *parent = nullptr);
|
2020-01-16 16:01:54 +03:00
|
|
|
static QMap<int, QByteArray> iconCache;
|
2020-01-13 16:35:58 +03:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void newNotificationList(ActivityList);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void slotFetchNotifications();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void slotNotificationsReceived(const QJsonDocument &json, int statusCode);
|
|
|
|
void slotEtagResponseHeaderReceived(const QByteArray &value, int statusCode);
|
|
|
|
void slotIconDownloaded(QByteArray iconData);
|
2021-03-30 13:53:47 +03:00
|
|
|
void slotAllowDesktopNotificationsChanged(bool isAllowed);
|
2020-01-13 16:35:58 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
QPointer<JsonApiJob> _notificationJob;
|
|
|
|
AccountState *_accountState;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // NOTIFICATIONHANDLER_H
|