Room Creation: Update existing room creation screen

- Remove account info when only one account is active.
- Support room avatar.
- TODO: Apply Ribot design.
This commit is contained in:
giomfo
2016-01-22 10:50:51 +01:00
parent bb808eaad9
commit 5db9040e10
3 changed files with 102 additions and 19 deletions
@@ -198,6 +198,34 @@
roomCreationRequest = nil;
// Check wheter an image has been selected
if (_roomCreationInputs.roomPicture)
{
// Make sure its orientation is up
UIImage *updatedPicture = [MXKTools forceImageOrientationUp:_roomCreationInputs.roomPicture];
// Upload picture
MXKMediaLoader *uploader = [MXKMediaManager prepareUploaderWithMatrixSession:_roomCreationInputs.mxSession initialRange:0 andRange:1.0];
[uploader uploadData:UIImageJPEGRepresentation(updatedPicture, 0.5) filename:nil mimeType:@"image/jpeg" success:^(NSString *url) {
[room setAvatar:url success:nil failure:^(NSError *error) {
NSLog(@"[RoomCreation] Failed to update the room avatar %@", error);
// Alert user
[[AppDelegate theDelegate] showErrorAsAlert:error];
}];
} failure:^(NSError *error) {
NSLog(@"[RoomCreation] Failed to upload image: %@", error);
// Alert user
[[AppDelegate theDelegate] showErrorAsAlert:error];
}];
}
// Check whether some users must be invited
NSArray *invitedUsers = _roomCreationInputs.roomParticipants;
for (NSString *userId in invitedUsers)