Permission Manager

Add permission manager from Itinerary so that Android permissions can be checked.

Note at the moment the request permission functions are not hooked up so on Android the permission will need to be manually set on. I'll hook this up later but I wanted to confirm my suspicion on notifications being the current cause of crashes.
This commit is contained in:
James Graham
2024-10-01 17:29:39 +00:00
parent 45439e17c9
commit 644f5c0ce1
50 changed files with 3344 additions and 1 deletions

View File

@@ -23,6 +23,7 @@
#include "controller.h"
#include "neochatconnection.h"
#include "neochatroom.h"
#include "permissionmanager.h"
#include "roommanager.h"
#include "texthandler.h"
#include "windowcontroller.h"
@@ -42,6 +43,10 @@ NotificationsManager::NotificationsManager(QObject *parent)
void NotificationsManager::handleNotifications(QPointer<NeoChatConnection> connection)
{
if (!PermissionManager::instance().checkPermission(Permission::PostNotification)) {
return;
}
if (!m_connActiveJob.contains(connection->user()->id())) {
auto job = connection->callApi<GetNotificationsJob>();
m_connActiveJob.append(connection->user()->id());