mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-30 00:02:47 +00:00
Room summary: beginning
This commit is contained in:
parent
516e438f49
commit
c7a480d4b3
6 changed files with 15 additions and 12 deletions
|
@ -66,7 +66,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Room display name
|
#pragma mark - Room display name
|
||||||
|
// @TODO: May worth to refactor to use MXRoomSummary
|
||||||
- (NSString *)vectorDisplayname
|
- (NSString *)vectorDisplayname
|
||||||
{
|
{
|
||||||
// this algo is the one defined in
|
// this algo is the one defined in
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
- (void)update
|
- (void)update
|
||||||
{
|
{
|
||||||
[super update];
|
[super update];
|
||||||
roomDisplayname = self.roomDataSource.room.vectorDisplayname;
|
roomDisplayname = self.roomSummary.room.vectorDisplayname;
|
||||||
if (!roomDisplayname.length)
|
if (!roomDisplayname.length)
|
||||||
{
|
{
|
||||||
roomDisplayname = NSLocalizedStringFromTable(@"room_displayname_no_title", @"Vector", nil);
|
roomDisplayname = NSLocalizedStringFromTable(@"room_displayname_no_title", @"Vector", nil);
|
||||||
|
|
|
@ -532,7 +532,7 @@
|
||||||
{
|
{
|
||||||
id<MXKRecentCellDataStoring> cellDataStoring = [cellDataArray objectAtIndex:index];
|
id<MXKRecentCellDataStoring> cellDataStoring = [cellDataArray objectAtIndex:index];
|
||||||
|
|
||||||
if ([roomId isEqualToString:cellDataStoring.roomDataSource.roomId] && (matrixSession == cellDataStoring.roomDataSource.mxSession))
|
if ([roomId isEqualToString:cellDataStoring.roomSummary.roomId] && (matrixSession == cellDataStoring.roomSummary.room.mxSession))
|
||||||
{
|
{
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
@ -667,7 +667,7 @@
|
||||||
{
|
{
|
||||||
NSUInteger pos;
|
NSUInteger pos;
|
||||||
id<MXKRecentCellDataStoring> recentCellDataStoring = [recentsDataSource cellDataAtIndex:index];
|
id<MXKRecentCellDataStoring> recentCellDataStoring = [recentsDataSource cellDataAtIndex:index];
|
||||||
MXRoom* room = recentCellDataStoring.roomDataSource.room;
|
MXRoom* room = recentCellDataStoring.roomSummary.room;
|
||||||
|
|
||||||
if ((pos = [sortedFavRooms indexOfObject:room]) != NSNotFound)
|
if ((pos = [sortedFavRooms indexOfObject:room]) != NSNotFound)
|
||||||
{
|
{
|
||||||
|
|
|
@ -330,7 +330,7 @@
|
||||||
{
|
{
|
||||||
id<MXKRecentCellDataStoring> cellDataStoring = (id<MXKRecentCellDataStoring> )cellData;
|
id<MXKRecentCellDataStoring> cellDataStoring = (id<MXKRecentCellDataStoring> )cellData;
|
||||||
|
|
||||||
if (NSNotFound == [cellDataStoring.recentsDataSource.mxSession.invitedRooms indexOfObject:cellDataStoring.roomDataSource.room])
|
if (NSNotFound == [cellDataStoring.recentsDataSource.mxSession.invitedRooms indexOfObject:cellDataStoring.roomSummary.room])
|
||||||
{
|
{
|
||||||
return RecentTableViewCell.class;
|
return RecentTableViewCell.class;
|
||||||
}
|
}
|
||||||
|
@ -344,7 +344,7 @@
|
||||||
{
|
{
|
||||||
id<MXKRecentCellDataStoring> cellDataStoring = (id<MXKRecentCellDataStoring> )cellData;
|
id<MXKRecentCellDataStoring> cellDataStoring = (id<MXKRecentCellDataStoring> )cellData;
|
||||||
|
|
||||||
if (NSNotFound == [cellDataStoring.recentsDataSource.mxSession.invitedRooms indexOfObject:cellDataStoring.roomDataSource.room])
|
if (NSNotFound == [cellDataStoring.recentsDataSource.mxSession.invitedRooms indexOfObject:cellDataStoring.roomSummary.room])
|
||||||
{
|
{
|
||||||
return RecentTableViewCell.defaultReuseIdentifier;
|
return RecentTableViewCell.defaultReuseIdentifier;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ NSString *const kInviteRecentTableViewCellRoomKey = @"kInviteRecentTableViewCell
|
||||||
{
|
{
|
||||||
if (self.delegate)
|
if (self.delegate)
|
||||||
{
|
{
|
||||||
MXRoom *room = roomCellData.roomDataSource.room;
|
MXRoom *room = roomCellData.roomSummary.room;
|
||||||
|
|
||||||
if (room)
|
if (room)
|
||||||
{
|
{
|
||||||
|
@ -75,7 +75,7 @@ NSString *const kInviteRecentTableViewCellRoomKey = @"kInviteRecentTableViewCell
|
||||||
{
|
{
|
||||||
if (self.delegate)
|
if (self.delegate)
|
||||||
{
|
{
|
||||||
MXRoom *room = roomCellData.roomDataSource.room;
|
MXRoom *room = roomCellData.roomSummary.room;
|
||||||
|
|
||||||
if (room)
|
if (room)
|
||||||
{
|
{
|
||||||
|
|
|
@ -127,11 +127,14 @@
|
||||||
|
|
||||||
self.roomAvatar.backgroundColor = [UIColor clearColor];
|
self.roomAvatar.backgroundColor = [UIColor clearColor];
|
||||||
|
|
||||||
self.directRoomIcon.hidden = !roomCellData.roomDataSource.room.isDirect;
|
// @TODO
|
||||||
|
self.directRoomIcon.hidden = !roomCellData.roomSummary.room.isDirect;
|
||||||
|
|
||||||
self.encryptedRoomIcon.hidden = !roomCellData.roomDataSource.room.state.isEncrypted;
|
// @TODO
|
||||||
|
self.encryptedRoomIcon.hidden = !roomCellData.roomSummary.room.state.isEncrypted;
|
||||||
|
|
||||||
[roomCellData.roomDataSource.room setRoomAvatarImageIn:self.roomAvatar];
|
// @TODO
|
||||||
|
[roomCellData.roomSummary.room setRoomAvatarImageIn:self.roomAvatar];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue