mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-21 17:12:45 +02:00
Add threadId parameter to room navigation parameters
This commit is contained in:
@@ -1280,6 +1280,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
||||
}
|
||||
|
||||
NSString *roomIdOrAlias;
|
||||
NSString *threadId;
|
||||
NSString *eventId;
|
||||
NSString *userId;
|
||||
NSString *groupId;
|
||||
@@ -1361,7 +1362,16 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
||||
else
|
||||
{
|
||||
// Open the room page
|
||||
RoomNavigationParameters *roomNavigationParameters = [[RoomNavigationParameters alloc] initWithRoomId:roomId eventId:eventId mxSession:account.mxSession presentationParameters: screenPresentationParameters];
|
||||
if (eventId)
|
||||
{
|
||||
MXEvent *event = [account.mxSession.store eventWithEventId:eventId inRoom:roomId];
|
||||
threadId = event.threadIdentifier;
|
||||
}
|
||||
RoomNavigationParameters *roomNavigationParameters = [[RoomNavigationParameters alloc] initWithRoomId:roomId
|
||||
threadId:threadId
|
||||
eventId:eventId
|
||||
mxSession:account.mxSession
|
||||
presentationParameters:screenPresentationParameters];
|
||||
|
||||
[self showRoomWithParameters:roomNavigationParameters];
|
||||
}
|
||||
@@ -2883,7 +2893,10 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
||||
ScreenPresentationParameters *presentationParameters = [[ScreenPresentationParameters alloc] initWithRestoreInitialDisplay:YES];
|
||||
|
||||
RoomNavigationParameters *parameters = [[RoomNavigationParameters alloc] initWithRoomId:roomId
|
||||
eventId:eventId mxSession:mxSession presentationParameters:presentationParameters];
|
||||
threadId:nil
|
||||
eventId:eventId
|
||||
mxSession:mxSession
|
||||
presentationParameters:presentationParameters];
|
||||
|
||||
[self showRoomWithParameters:parameters];
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ class RoomNavigationParameters: NSObject {
|
||||
/// The room identifier
|
||||
let roomId: String
|
||||
|
||||
/// If not nil, the thread will be opened on this room
|
||||
let threadId: String?
|
||||
|
||||
/// If not nil, the room will be opened on this event.
|
||||
let eventId: String?
|
||||
|
||||
@@ -37,10 +40,12 @@ class RoomNavigationParameters: NSObject {
|
||||
// MARK: - Setup
|
||||
|
||||
init(roomId: String,
|
||||
threadId: String?,
|
||||
eventId: String?,
|
||||
mxSession: MXSession,
|
||||
presentationParameters: ScreenPresentationParameters) {
|
||||
self.roomId = roomId
|
||||
self.threadId = threadId
|
||||
self.eventId = eventId
|
||||
self.mxSession = mxSession
|
||||
self.presentationParameters = presentationParameters
|
||||
|
||||
@@ -32,6 +32,7 @@ class RoomPreviewNavigationParameters: RoomNavigationParameters {
|
||||
self.previewData = previewData
|
||||
|
||||
super.init(roomId: previewData.roomId,
|
||||
threadId: nil,
|
||||
eventId: previewData.eventId,
|
||||
mxSession: previewData.mxSession,
|
||||
presentationParameters: presentationParameters)
|
||||
|
||||
Reference in New Issue
Block a user