Skip to content

Commit

Permalink
Merge branch 'release/tchap_v1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
giomfo committed Nov 19, 2020
2 parents df8eef6 + 74c6529 commit 8e1ac07
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 11 deletions.
12 changes: 10 additions & 2 deletions Riot/Model/Room/RoomPreviewData.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,18 @@
Contructors.
@param roomId the id of the room.
@param emailInvitationParams, in case of an email invitation link, the query parameters extracted from the link.
@param roomAlias the potential alias (we have keep it when it is available. It may be required to join federated room).
@param mxSession the session to open the room preview with.
*/
- (instancetype)initWithRoomId:(NSString*)roomId andSession:(MXSession*)mxSession;
- (instancetype)initWithRoomId:(NSString*)roomId roomAlias:(NSString*)roomAlias andSession:(MXSession*)mxSession;

/**
Contructors.
@param roomId the id of the room.
@param emailInvitationParams, in case of an email invitation link, the query parameters extracted from the link.
@param mxSession the session to open the room preview with.
*/
- (instancetype)initWithRoomId:(NSString*)roomId emailInvitationParams:(NSDictionary*)emailInvitationParams andSession:(MXSession*)mxSession;

/**
Expand Down
8 changes: 4 additions & 4 deletions Riot/Model/Room/RoomPreviewData.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@

@implementation RoomPreviewData

- (instancetype)initWithRoomId:(NSString *)roomId andSession:(MXSession *)mxSession
- (instancetype)initWithRoomId:(NSString *)roomId roomAlias:(NSString*)roomAlias andSession:(MXSession *)mxSession
{
self = [super init];
if (self)
{
_roomId = roomId;
_roomCanonicalAlias = roomAlias;
_mxSession = mxSession;
_numJoinedMembers = -1;
}
Expand All @@ -33,7 +34,7 @@ - (instancetype)initWithRoomId:(NSString *)roomId andSession:(MXSession *)mxSess

- (instancetype)initWithRoomId:(NSString *)roomId emailInvitationParams:(NSDictionary *)emailInvitationParams andSession:(MXSession *)mxSession
{
self = [self initWithRoomId:roomId andSession:mxSession];
self = [self initWithRoomId:roomId roomAlias:nil andSession:mxSession];
if (self)
{
_emailInvitation = [[RoomEmailInvitation alloc] initWithParams:emailInvitationParams];
Expand All @@ -47,14 +48,13 @@ - (instancetype)initWithRoomId:(NSString *)roomId emailInvitationParams:(NSDicti

- (instancetype)initWithPublicRoom:(MXPublicRoom*)publicRoom andSession:(MXSession*)mxSession
{
self = [self initWithRoomId:publicRoom.roomId andSession:mxSession];
self = [self initWithRoomId:publicRoom.roomId roomAlias:publicRoom.canonicalAlias andSession:mxSession];
if (self)
{
// Report public room data
_roomName = publicRoom.displayname;
_roomAvatarUrl = publicRoom.avatarUrl;
_roomTopic = publicRoom.topic;
_roomCanonicalAlias = publicRoom.canonicalAlias;
_roomAliases = publicRoom.aliases;
_numJoinedMembers = publicRoom.numJoinedMembers;

Expand Down
7 changes: 7 additions & 0 deletions TCHAP_CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Changes in Tchap 1.1.0 (2020-11-19)
===================================================

Bug Fixes:
* [Room Preview] unexpected failure on join: "Not possible to join an empty room" #346
* Wrong error message displayed to the external users when they try to join a room by link

Changes in Tchap 1.0.30 (2020-11-17)
===================================================

Expand Down
4 changes: 2 additions & 2 deletions Tchap.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9379,7 +9379,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.0.30;
MARKETING_VERSION = 1.1.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -9431,7 +9431,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 1.0.30;
MARKETING_VERSION = 1.1.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down
4 changes: 2 additions & 2 deletions Tchap/Modules/Home/HomeCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ final class HomeCoordinator: NSObject, HomeCoordinatorType {

switch response {
case .success(let roomId):
let roomPreviewData: RoomPreviewData = RoomPreviewData(roomId: roomId, andSession: sself.session)
let roomPreviewData: RoomPreviewData = RoomPreviewData(roomId: roomId, roomAlias: roomIdOrAlias, andSession: sself.session)
roomPreviewData.roomName = roomName != nil ? roomName : roomIdOrAlias

sself.showRoomPreview(with: roomPreviewData, onEventID: eventID)
Expand All @@ -143,7 +143,7 @@ final class HomeCoordinator: NSObject, HomeCoordinatorType {
}
}
} else {
let roomPreviewData: RoomPreviewData = RoomPreviewData(roomId: roomIdOrAlias, andSession: self.session)
let roomPreviewData: RoomPreviewData = RoomPreviewData(roomId: roomIdOrAlias, roomAlias: nil, andSession: self.session)
roomPreviewData.roomName = roomName != nil ? roomName : roomIdOrAlias

self.showRoomPreview(with: roomPreviewData, onEventID: eventID)
Expand Down
2 changes: 1 addition & 1 deletion Tchap/Modules/RoomPreview/RoomPreviewCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ final class RoomPreviewCoordinator: NSObject, RoomPreviewCoordinatorType {
// 'Error when trying to join an empty room should be more explicit'
errorMessage = Bundle.mxk_localizedString(forKey: "room_error_join_failed_empty_room")
} else {
errorMessage = message
errorMessage = TchapL10n.tchapRoomAccessUnauthorized
}
} else {
errorMessage = TchapL10n.errorMessageDefault
Expand Down

0 comments on commit 8e1ac07

Please sign in to comment.