зеркало из https://github.com/nextcloud/talk-ios.git
Join/Leave rooms.
Signed-off-by: Ivan Sein <ivan@nextcloud.com>
This commit is contained in:
Родитель
787db76496
Коммит
1bceabd183
|
@ -14,5 +14,6 @@
|
|||
- (BOOL)isEnabled;
|
||||
- (void)setServer:(NSString *)serverUrl andTicket:(NSString *)ticket;
|
||||
- (void)joinRoom:(NSString *)roomId withSessionId:(NSString *)sessionId;
|
||||
- (void)leaveRoom:(NSString *)roomId;
|
||||
|
||||
@end
|
||||
|
|
|
@ -195,9 +195,9 @@ static NSTimeInterval kMaxReconnectInterval = 16;
|
|||
[_webSocket send:jsonString];
|
||||
}
|
||||
|
||||
- (void)leaveRoom:(NSString *)roomId withSessionId:(NSString *)sessionId
|
||||
- (void)leaveRoom:(NSString *)roomId
|
||||
{
|
||||
[self joinRoom:@"" withSessionId:sessionId];
|
||||
[self joinRoom:@"" withSessionId:@""];
|
||||
}
|
||||
|
||||
- (void)joinResponseReceived:(NSDictionary *)joinDict
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
#import "NCAPIController.h"
|
||||
#import "NCSettingsController.h"
|
||||
#import "NCExternalSignalingController.h"
|
||||
|
||||
NSString * const NCRoomControllerDidReceiveInitialChatHistoryNotification = @"NCRoomControllerDidReceiveInitialChatHistoryNotification";
|
||||
NSString * const NCRoomControllerDidReceiveChatHistoryNotification = @"NCRoomControllerDidReceiveChatHistoryNotification";
|
||||
|
@ -39,9 +38,6 @@ NSString * const NCRoomControllerDidReceiveChatMessagesNotification = @"
|
|||
if (![[NCSettingsController sharedInstance] serverHasTalkCapability:kCapabilityNoPing]) {
|
||||
[self startPingRoom];
|
||||
}
|
||||
if ([[NCExternalSignalingController sharedInstance] isEnabled]) {
|
||||
[[NCExternalSignalingController sharedInstance] joinRoom:token withSessionId:sessionId];
|
||||
}
|
||||
}
|
||||
|
||||
return self;
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#import "RoomCreation2TableViewController.h"
|
||||
#import "NCAPIController.h"
|
||||
#import "NCChatMessage.h"
|
||||
#import "NCExternalSignalingController.h"
|
||||
#import "NCRoomController.h"
|
||||
#import "NCSettingsController.h"
|
||||
#import "NCUserInterfaceController.h"
|
||||
|
@ -85,6 +86,9 @@ NSString * const NCRoomsManagerDidReceiveChatMessagesNotification = @"ChatMess
|
|||
controller.inCall = call;
|
||||
[_activeRooms setObject:controller forKey:room.token];
|
||||
[userInfo setObject:controller forKey:@"roomController"];
|
||||
if ([[NCExternalSignalingController sharedInstance] isEnabled]) {
|
||||
[[NCExternalSignalingController sharedInstance] joinRoom:room.token withSessionId:sessionId];
|
||||
}
|
||||
} else {
|
||||
[userInfo setObject:error forKey:@"error"];
|
||||
NSLog(@"Could not join room. Error: %@", error.description);
|
||||
|
@ -122,7 +126,11 @@ NSString * const NCRoomsManagerDidReceiveChatMessagesNotification = @"ChatMess
|
|||
|
||||
[[NCAPIController sharedInstance] exitRoom:room.token withCompletionBlock:^(NSError *error) {
|
||||
NSMutableDictionary *userInfo = [NSMutableDictionary new];
|
||||
if (error) {
|
||||
if (!error) {
|
||||
if ([[NCExternalSignalingController sharedInstance] isEnabled]) {
|
||||
[[NCExternalSignalingController sharedInstance] leaveRoom:room.token];
|
||||
}
|
||||
} else {
|
||||
[userInfo setObject:error forKey:@"error"];
|
||||
NSLog(@"Could not exit room. Error: %@", error.description);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче