2014-10-02 15:02:47 +00:00
|
|
|
/*
|
|
|
|
Copyright 2014 OpenMarket Ltd
|
2017-03-09 10:50:12 +00:00
|
|
|
Copyright 2017 Vector Creations Ltd
|
2014-10-02 15:02:47 +00:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2021-11-30 15:09:53 +00:00
|
|
|
#import "MatrixKit.h"
|
2014-10-02 15:02:47 +00:00
|
|
|
|
2016-02-10 09:59:48 +00:00
|
|
|
#import "RoomTitleView.h"
|
|
|
|
|
2016-04-15 07:43:56 +00:00
|
|
|
#import "RoomPreviewData.h"
|
2016-04-14 00:34:30 +00:00
|
|
|
|
2016-05-26 16:30:41 +00:00
|
|
|
#import "RoomParticipantsViewController.h"
|
|
|
|
|
2017-06-20 09:32:54 +00:00
|
|
|
#import "ContactsTableViewController.h"
|
|
|
|
|
2017-03-09 10:50:12 +00:00
|
|
|
#import "UIViewController+RiotSearch.h"
|
2015-12-30 14:15:08 +00:00
|
|
|
|
2021-03-20 20:31:17 +00:00
|
|
|
@class BadgeLabel;
|
2021-10-12 17:12:08 +00:00
|
|
|
@class UniversalLinkParameters;
|
2021-09-07 15:43:49 +00:00
|
|
|
@protocol RoomViewControllerDelegate;
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
2021-03-20 20:31:17 +00:00
|
|
|
|
2021-01-21 11:27:32 +00:00
|
|
|
/**
|
|
|
|
Notification string used to indicate call tile tapped in a room. Notification object will be the `RoomBubbleCellData` object.
|
|
|
|
*/
|
2021-09-17 12:19:38 +00:00
|
|
|
extern NSNotificationName const RoomCallTileTappedNotification;
|
2021-01-21 11:27:32 +00:00
|
|
|
|
2021-03-17 16:41:31 +00:00
|
|
|
/**
|
|
|
|
Notification string used to indicate group call tile tapped in a room. Notification object will be the `RoomBubbleCellData` object.
|
|
|
|
*/
|
2021-09-17 12:19:38 +00:00
|
|
|
extern NSNotificationName const RoomGroupCallTileTappedNotification;
|
2021-03-17 16:41:31 +00:00
|
|
|
|
2018-10-04 16:37:25 +00:00
|
|
|
@interface RoomViewController : MXKRoomViewController
|
2016-02-10 09:59:48 +00:00
|
|
|
|
2021-09-07 15:43:49 +00:00
|
|
|
|
|
|
|
// The delegate for the view controller.
|
|
|
|
@property (weak, nonatomic, nullable) id<RoomViewControllerDelegate> delegate;
|
|
|
|
|
2016-04-14 00:34:30 +00:00
|
|
|
// The preview header
|
2021-09-07 15:43:49 +00:00
|
|
|
@property (weak, nonatomic, nullable) IBOutlet UIView *previewHeaderContainer;
|
|
|
|
@property (weak, nonatomic, nullable) IBOutlet NSLayoutConstraint *previewHeaderContainerHeightConstraint;
|
2016-04-14 00:34:30 +00:00
|
|
|
|
2017-06-01 15:20:08 +00:00
|
|
|
// The jump to last unread banner
|
2021-09-07 15:43:49 +00:00
|
|
|
@property (weak, nonatomic, nullable) IBOutlet UIView *jumpToLastUnreadBannerContainer;
|
|
|
|
@property (weak, nonatomic, nullable) IBOutlet UIView *jumpToLastUnreadBanner;
|
|
|
|
@property (weak, nonatomic, nullable) IBOutlet UIImageView *jumpToLastUnreadImageView;
|
|
|
|
@property (weak, nonatomic, nullable) IBOutlet UIButton *jumpToLastUnreadButton;
|
|
|
|
@property (weak, nonatomic, nullable) IBOutlet UILabel *jumpToLastUnreadLabel;
|
|
|
|
@property (weak, nonatomic, nullable) IBOutlet UIButton *resetReadMarkerButton;
|
|
|
|
@property (weak, nonatomic, nullable) IBOutlet UIView *inputBackgroundView;
|
|
|
|
@property (weak, nonatomic, nullable) IBOutlet UIButton *scrollToBottomButton;
|
|
|
|
@property (weak, nonatomic, nullable) IBOutlet BadgeLabel *scrollToBottomBadgeLabel;
|
2017-06-01 15:20:08 +00:00
|
|
|
|
2021-04-23 15:36:51 +00:00
|
|
|
// Remove Jitsi widget container
|
2021-09-07 15:43:49 +00:00
|
|
|
@property (weak, nonatomic, nullable) IBOutlet UIView *removeJitsiWidgetContainer;
|
2021-04-23 15:36:51 +00:00
|
|
|
|
2016-06-10 15:15:42 +00:00
|
|
|
/**
|
|
|
|
Preview data for a room invitation received by email, or a link to a room.
|
|
|
|
*/
|
2021-09-07 15:43:49 +00:00
|
|
|
@property (nonatomic, readonly, nullable) RoomPreviewData *roomPreviewData;
|
2016-06-10 15:15:42 +00:00
|
|
|
|
2018-01-16 22:49:04 +00:00
|
|
|
/**
|
|
|
|
Tell whether a badge must be added next to the chevron (back button) showing number of unread rooms.
|
|
|
|
YES by default.
|
|
|
|
*/
|
|
|
|
@property (nonatomic) BOOL showMissedDiscussionsBadge;
|
|
|
|
|
2016-04-14 00:34:30 +00:00
|
|
|
/**
|
2016-04-15 07:43:56 +00:00
|
|
|
Display the preview of a room that is unknown for the user.
|
|
|
|
|
|
|
|
This room can come from an email invitation link or a simple link to a room.
|
|
|
|
|
|
|
|
@param roomPreviewData the data for the room preview.
|
2016-04-14 00:34:30 +00:00
|
|
|
*/
|
2021-09-17 12:19:38 +00:00
|
|
|
- (void)displayRoomPreview:(RoomPreviewData*)roomPreviewData;
|
2015-01-30 17:47:43 +00:00
|
|
|
|
2017-06-01 15:20:08 +00:00
|
|
|
/**
|
|
|
|
Action used to handle some buttons.
|
|
|
|
*/
|
|
|
|
- (IBAction)onButtonPressed:(id)sender;
|
|
|
|
|
2021-03-20 20:31:17 +00:00
|
|
|
- (IBAction)scrollToBottomAction:(id)sender;
|
|
|
|
|
2021-09-07 15:43:49 +00:00
|
|
|
/**
|
|
|
|
Creates and returns a new `RoomViewController` object.
|
|
|
|
|
|
|
|
@return An initialized `RoomViewController` object.
|
|
|
|
*/
|
2021-09-17 12:19:38 +00:00
|
|
|
+ (instancetype)instantiate;
|
2021-09-07 15:43:49 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
/**
|
|
|
|
`RoomViewController` delegate.
|
|
|
|
*/
|
|
|
|
@protocol RoomViewControllerDelegate <NSObject>
|
|
|
|
|
|
|
|
/**
|
|
|
|
Tells the delegate that the user wants to open the room details (members, files, settings).
|
|
|
|
|
|
|
|
@param roomViewController the `RoomViewController` instance.
|
|
|
|
*/
|
2021-09-17 12:19:38 +00:00
|
|
|
- (void)roomViewControllerShowRoomDetails:(RoomViewController *)roomViewController;
|
2021-09-07 15:43:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Tells the delegate that the user wants to display the details of a room member.
|
|
|
|
|
|
|
|
@param roomViewController the `RoomViewController` instance.
|
|
|
|
@param roomMember the selected member
|
|
|
|
*/
|
2021-09-17 12:19:38 +00:00
|
|
|
- (void)roomViewController:(RoomViewController *)roomViewController
|
|
|
|
showMemberDetails:(MXRoomMember *)roomMember;
|
2021-09-07 15:43:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Tells the delegate that the user wants to display another room.
|
|
|
|
|
|
|
|
@param roomViewController the `RoomViewController` instance.
|
|
|
|
@param roomID the selected roomId
|
|
|
|
*/
|
2021-09-17 12:19:38 +00:00
|
|
|
- (void)roomViewController:(RoomViewController *)roomViewController
|
|
|
|
showRoomWithId:(NSString *)roomID;
|
2021-09-07 15:43:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Tells the delegate that the user wants to start a direct chat with a user.
|
|
|
|
|
|
|
|
@param roomViewController the `RoomViewController` instance.
|
|
|
|
@param userId the selected user id
|
|
|
|
@param completion Blocks called when the chat is created.
|
|
|
|
*/
|
2021-09-17 12:19:38 +00:00
|
|
|
- (void)roomViewController:(RoomViewController *)roomViewController
|
2021-09-07 15:43:49 +00:00
|
|
|
startChatWithUserId:(NSString*)userId
|
|
|
|
completion:(void (^)(void))completion;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Tells the delegate that the user wants to show complete security screen.
|
|
|
|
|
|
|
|
@param roomViewController the `RoomViewController` instance.
|
|
|
|
@param session The selected Matrix session.
|
|
|
|
*/
|
2021-09-17 12:19:38 +00:00
|
|
|
- (void)roomViewController:(RoomViewController *)roomViewController showCompleteSecurityForSession:(MXSession*)session;
|
2021-09-07 15:43:49 +00:00
|
|
|
|
|
|
|
/**
|
2021-09-17 11:21:53 +00:00
|
|
|
Tells the delegate that the user left the room.
|
2021-09-07 15:43:49 +00:00
|
|
|
|
|
|
|
@param roomViewController the `RoomViewController` instance.
|
|
|
|
*/
|
2021-09-17 12:19:38 +00:00
|
|
|
- (void)roomViewControllerDidLeaveRoom:(RoomViewController *)roomViewController;
|
2021-09-07 15:43:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Tells the delegate that the user wants to cancel the room preview.
|
|
|
|
|
|
|
|
@param roomViewController the `RoomViewController` instance.
|
|
|
|
*/
|
2021-09-17 12:19:38 +00:00
|
|
|
- (void)roomViewControllerPreviewDidTapCancel:(RoomViewController *)roomViewController;
|
2021-09-07 15:43:49 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Process universal link.
|
2021-10-12 17:12:08 +00:00
|
|
|
|
2021-09-07 15:43:49 +00:00
|
|
|
@param roomViewController the `RoomViewController` instance.
|
2021-10-12 17:12:08 +00:00
|
|
|
@param parameters the universal link parameters.
|
2021-09-07 15:43:49 +00:00
|
|
|
@return YES in case of processing success.
|
|
|
|
*/
|
2021-09-17 12:19:38 +00:00
|
|
|
- (BOOL)roomViewController:(RoomViewController *)roomViewController
|
2021-10-12 17:12:08 +00:00
|
|
|
handleUniversalLinkWithParameters:(UniversalLinkParameters*)parameters;
|
2021-09-07 15:43:49 +00:00
|
|
|
|
2021-11-01 14:52:00 +00:00
|
|
|
/**
|
|
|
|
Ask the coordinator to invoke the poll creation form coordinator.
|
|
|
|
|
|
|
|
@param roomViewController the `RoomViewController` instance.
|
|
|
|
*/
|
|
|
|
- (void)roomViewControllerDidRequestPollCreationFormPresentation:(RoomViewController *)roomViewController;
|
|
|
|
|
2021-12-16 12:02:42 +00:00
|
|
|
/**
|
|
|
|
Ask the coordinator to invoke the location sharing form coordinator.
|
|
|
|
|
|
|
|
@param roomViewController the `RoomViewController` instance.
|
|
|
|
*/
|
|
|
|
- (void)roomViewControllerDidRequestLocationSharingFormPresentation:(RoomViewController *)roomViewController;
|
|
|
|
|
2021-12-20 15:33:59 +00:00
|
|
|
/**
|
|
|
|
Ask the coordinator to invoke the location sharing form coordinator.
|
|
|
|
|
|
|
|
@param roomViewController the `RoomViewController` instance.
|
|
|
|
@param event the event containing location information
|
|
|
|
@param bubbleData the bubble data containing sender details
|
|
|
|
*/
|
|
|
|
- (void)roomViewController:(RoomViewController *)roomViewController
|
|
|
|
didRequestLocationPresentationForEvent:(MXEvent *)event
|
|
|
|
bubbleData:(id<MXKRoomBubbleCellDataStoring>)bubbleData;
|
|
|
|
|
2021-11-19 15:40:52 +00:00
|
|
|
- (BOOL)roomViewController:(RoomViewController *)roomViewController
|
|
|
|
canEndPollWithEventIdentifier:(NSString *)eventIdentifier;
|
|
|
|
|
|
|
|
- (void)roomViewController:(RoomViewController *)roomViewController
|
|
|
|
endPollWithEventIdentifier:(NSString *)eventIdentifier;
|
|
|
|
|
2022-01-12 06:44:53 +00:00
|
|
|
- (BOOL)roomViewController:(RoomViewController *)roomViewController
|
|
|
|
canEditPollWithEventIdentifier:(NSString *)eventIdentifier;
|
|
|
|
|
|
|
|
- (void)roomViewController:(RoomViewController *)roomViewController
|
|
|
|
didRequestEditForPollWithStartEvent:(MXEvent *)startEvent;
|
|
|
|
|
2014-10-02 15:02:47 +00:00
|
|
|
@end
|
|
|
|
|
2021-09-07 15:43:49 +00:00
|
|
|
NS_ASSUME_NONNULL_END
|