mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-30 21:26:57 +02:00
Add Room Member Details screen
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
#import "RoomParticipantsViewController.h"
|
||||
|
||||
#import "RoomMemberDetailsViewController.h"
|
||||
|
||||
#import "VectorDesignValues.h"
|
||||
|
||||
#import "RageShakeManager.h"
|
||||
@@ -47,6 +49,8 @@
|
||||
|
||||
// Observe kMXSessionWillLeaveRoomNotification to be notified if the user leaves the current room.
|
||||
id leaveRoomNotificationObserver;
|
||||
|
||||
RoomMemberDetailsViewController *detailsViewController;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -161,6 +165,12 @@
|
||||
{
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
if (detailsViewController)
|
||||
{
|
||||
[detailsViewController destroy];
|
||||
detailsViewController = nil;
|
||||
}
|
||||
|
||||
// Refresh display
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
@@ -795,6 +805,53 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (indexPath.section == participantsSection)
|
||||
{
|
||||
Contact *contact;
|
||||
|
||||
// oneself dedicated cell
|
||||
if (userMatrixId && indexPath.row == 0)
|
||||
{
|
||||
contact = [mxkContactsById objectForKey:userMatrixId];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSInteger index = indexPath.row;
|
||||
|
||||
if (userMatrixId)
|
||||
{
|
||||
index --;
|
||||
}
|
||||
|
||||
if (index < mutableParticipants.count)
|
||||
{
|
||||
NSString *userId = mutableParticipants[index];
|
||||
contact = [mxkContactsById objectForKey:userId];
|
||||
}
|
||||
}
|
||||
|
||||
if (contact)
|
||||
{
|
||||
detailsViewController = [RoomMemberDetailsViewController roomMemberDetailsViewController];
|
||||
[detailsViewController displayRoomMember:contact.mxMember withMatrixRoom:self.mxRoom];
|
||||
|
||||
// Check whether the view controller is displayed inside a segmented one.
|
||||
if (self.segmentedViewController)
|
||||
{
|
||||
// Hide back button title
|
||||
self.segmentedViewController.navigationItem.backBarButtonItem =[[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
|
||||
|
||||
[self.segmentedViewController.navigationController pushViewController:detailsViewController animated:YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Hide back button title
|
||||
self.navigationItem.backBarButtonItem =[[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
|
||||
|
||||
[self.navigationController pushViewController:detailsViewController animated:YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user