Add Room Member Details screen

This commit is contained in:
giomfo
2016-02-24 10:08:21 +01:00
parent db361078c5
commit b91c183b1c
22 changed files with 1020 additions and 4 deletions
@@ -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];
}