mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-30 21:26:57 +02:00
Search result display: Display the result in a RoomVC from RoomSearchVC
This commit is contained in:
@@ -19,13 +19,25 @@
|
||||
#import "UIViewController+VectorSearch.h"
|
||||
|
||||
// Use RoomViewController cells to display results
|
||||
#import "RoomBubbleCellData.h"
|
||||
#import "RoomIncomingAttachmentBubbleCell.h"
|
||||
#import "RoomIncomingTextMsgBubbleCell.h"
|
||||
|
||||
#import "RoomViewController.h"
|
||||
#import "RoomDataSource.h"
|
||||
|
||||
#import "VectorDesignValues.h"
|
||||
|
||||
#import "RageShakeManager.h"
|
||||
|
||||
@interface RoomSearchViewController ()
|
||||
{
|
||||
// The event selected in the search results
|
||||
MXEvent *selectedEvent;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation RoomSearchViewController
|
||||
|
||||
- (void)viewDidLoad
|
||||
@@ -132,4 +144,32 @@
|
||||
return [super tableView:tableView heightForRowAtIndexPath:indexPath] + 1;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
// Data in the cells are actually Vector RoomBubbleCellData
|
||||
RoomBubbleCellData *cellData = (RoomBubbleCellData*)[self.dataSource cellDataAtIndex:indexPath.row];
|
||||
selectedEvent = cellData.bubbleComponents[0].event;
|
||||
|
||||
// Open the RoomViewController
|
||||
[self performSegueWithIdentifier:@"showTimeline" sender:self];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Segues
|
||||
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
|
||||
{
|
||||
[super prepareForSegue:segue sender:sender];
|
||||
|
||||
if ([[segue identifier] isEqualToString:@"showTimeline"])
|
||||
{
|
||||
RoomViewController *roomViewController = segue.destinationViewController;
|
||||
|
||||
RoomDataSource *roomDataSource = [[RoomDataSource alloc] initWithRoomId:selectedEvent.roomId andInitialEventId:selectedEvent.eventId andMatrixSession:self.dataSource.mxSession];
|
||||
[roomDataSource finalizeInitialization];
|
||||
|
||||
[roomViewController displayRoom:roomDataSource];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user