ResolveResource

Use ResolveResource rather than calling individual functions like visit user and room
This commit is contained in:
James Graham
2023-11-26 12:23:28 +00:00
parent bb8ffb02d1
commit 27c9c62564
21 changed files with 123 additions and 82 deletions

View File

@@ -5,6 +5,7 @@
#include <Quotient/connection.h>
#include <Quotient/events/event.h>
#include <Quotient/uri.h>
#include "eventhandler.h"
#include "neochatroom.h"
@@ -49,6 +50,9 @@ QVariant NotificationsModel::data(const QModelIndex &index, int role) const
if (role == RoomDisplayNameRole) {
return m_notifications[row].roomDisplayName;
}
if (role == UriRole) {
return Uri(m_notifications[row].roomId.toLatin1(), m_notifications[row].eventId.toLatin1()).toUrl();
}
return {};
}
@@ -62,6 +66,7 @@ QHash<int, QByteArray> NotificationsModel::roleNames() const
{RoomRole, "room"},
{EventIdRole, "eventId"},
{RoomDisplayNameRole, "roomDisplayName"},
{UriRole, "uri"},
};
}