HyphenateChatSDK 5.0.0
IEMChatroomManager.h
15#import <Foundation/Foundation.h>
16
17#import "EMCommonDefs.h"
18#import "EMChatroomManagerDelegate.h"
19#import "EMChatroomOptions.h"
20#import "EMChatroom.h"
21#import "EMPageResult.h"
22
23#import "EMCursorResult.h"
24
25@class EMError;
26
34@protocol IEMChatroomManager <NSObject>
35
36@required
37
38#pragma mark - Delegate
39
53- (void)addDelegate:(id<EMChatroomManagerDelegate> _Nonnull)aDelegate
54 delegateQueue:(dispatch_queue_t _Nullable)aQueue;
55
67- (void)removeDelegate:(id<EMChatroomManagerDelegate> _Nonnull)aDelegate;
68
69#pragma mark - Fetch Chatrooms
70
94- (EMPageResult<EMChatroom*> *_Nullable)getChatroomsFromServerWithPage:(NSInteger)aPageNum
95 pageSize:(NSInteger)aPageSize
96 error:(EMError **_Nullable)pError;
97
119- (void)getChatroomsFromServerWithPage:(NSInteger)aPageNum
120 pageSize:(NSInteger)aPageSize
121 completion:(void (^_Nullable)(EMPageResult<EMChatroom*> *_Nullable aResult, EMError *_Nullable aError))aCompletionBlock;
122
123
124#pragma mark - Edit Chatroom
125
147- (EMChatroom *)joinChatroom:(NSString * _Nonnull)aChatroomId
148 error:(EMError ** _Nullable)pError;
149
169- (void)joinChatroom:(NSString *_Nonnull)aChatroomId
170 completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
171
198- (void)joinChatroom:(NSString *_Nonnull)aChatroomId
199 ext:(NSString* _Nullable)ext
200 leaveOtherRooms:(BOOL)leaveOtherRooms
201 completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
202
222- (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
223 error:(EMError **_Nullable)pError;
224
244- (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
245 completion:(void (^_Nullable)(EMError *_Nullable aError))aCompletionBlock;
246
247#pragma mark - Fetch
248
270- (EMChatroom *_Nullable)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
271 error:(EMError *_Nullable*)pError;
272
291- (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
292 completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
293
314- (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
315 fetchMembers:(bool)aFetchMembers
316 completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
317
344- (EMCursorResult<NSString*> *_Nullable)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
345 cursor:(NSString *_Nullable)aCursor
346 pageSize:(NSInteger)aPageSize
347 error:(EMError **_Nullable)pError;
348
372- (void)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
373 cursor:(NSString *_Nullable)aCursor
374 pageSize:(NSInteger)aPageSize
375 completion:(void (^_Nullable)(EMCursorResult<NSString*> *_Nullable aResult, EMError *_Nullable aError))aCompletionBlock;
376
404- (NSArray<NSString *> *_Nullable)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
405 pageNumber:(NSInteger)aPageNum
406 pageSize:(NSInteger)aPageSize
407 error:(EMError **_Nullable)pError;
408
436- (void)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
437 pageNumber:(NSInteger)aPageNum
438 pageSize:(NSInteger)aPageSize
439 completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
440
468- (NSArray<NSString *> *_Nullable)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
469 pageNumber:(NSInteger)aPageNum
470 pageSize:(NSInteger)aPageSize
471 error:(EMError **_Nullable)pError;
472
500- (void)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
501 pageNumber:(NSInteger)aPageNum
502 pageSize:(NSInteger)aPageSize
503 completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
504
505
529- (NSArray<NSString *> *_Nullable)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
530 error:(EMError **_Nullable)pError;
531
532
556- (void)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
557 completion:(void (^_Nullable)(NSArray<NSString *> *_Nullable aList, EMError *_Nullable aError))aCompletionBlock;
558
578- (BOOL)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
579 error:(EMError **_Nullable )pError;
580
600- (void)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
601 completion:(void (^_Nullable)(BOOL inWhiteList, EMError *_Nullable aError))aCompletionBlock;
602
622- (void)isMemberInMuteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
623 completion:(void (^_Nullable)(BOOL inMuteList, EMError *_Nullable aError))aCompletionBlock;
645- (NSString *_Nullable)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
646 error:(EMError **_Nullable )pError;
647
666- (void)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
667 completion:(void (^_Nullable)(NSString *_Nullable aAnnouncement, EMError *_Nullable aError))aCompletionBlock;
668
669#pragma mark - Edit
670
698- (EMChatroom *)updateSubject:(NSString *_Nullable )aSubject
699 forChatroom:(NSString *_Nonnull)aChatroomId
700 error:(EMError **_Nullable )pError;
701
727- (void)updateSubject:(NSString *_Nullable )aSubject
728 forChatroom:(NSString *_Nonnull)aChatroomId
729 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
730
758- (EMChatroom *_Nullable )updateDescription:(NSString *_Nullable )aDescription
759 forChatroom:(NSString *_Nonnull)aChatroomId
760 error:(EMError **_Nullable )pError;
761
787- (void)updateDescription:(NSString *_Nullable )aDescription
788 forChatroom:(NSString *_Nonnull)aChatroomId
789 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
790
818- (EMChatroom *_Nullable )removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
819 fromChatroom:(NSString *_Nonnull)aChatroomId
820 error:(EMError **_Nullable )pError;
821
847- (void)removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
848 fromChatroom:(NSString *_Nonnull)aChatroomId
849 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
850
878- (EMChatroom *_Nullable )blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
879 fromChatroom:(NSString *_Nonnull)aChatroomId
880 error:(EMError **_Nullable )pError;
881
907- (void)blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
908 fromChatroom:(NSString *_Nonnull)aChatroomId
909 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
910
911
939- (EMChatroom *_Nullable )unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
940 fromChatroom:(NSString *_Nonnull)aChatroomId
941 error:(EMError **_Nullable )pError;
942
968- (void)unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
969 fromChatroom:(NSString *_Nonnull)aChatroomId
970 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
971
999- (EMChatroom *_Nullable )updateChatroomOwner:(NSString *_Nonnull)aChatroomId
1000 newOwner:(NSString *_Nonnull)aNewOwner
1001 error:(EMError **_Nullable )pError;
1002
1028- (void)updateChatroomOwner:(NSString *_Nonnull)aChatroomId
1029 newOwner:(NSString *_Nonnull)aNewOwner
1030 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1031
1059- (EMChatroom *_Nullable )addAdmin:(NSString *_Nonnull)aAdmin
1060 toChatroom:(NSString *_Nonnull)aChatroomId
1061 error:(EMError **_Nullable )pError;
1062
1088- (void)addAdmin:(NSString *_Nonnull)aAdmin
1089 toChatroom:(NSString *_Nonnull)aChatroomId
1090 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroomp, EMError *_Nullable aError))aCompletionBlock;
1091
1119- (EMChatroom *_Nullable )removeAdmin:(NSString *_Nonnull)aAdmin
1120 fromChatroom:(NSString *_Nonnull)aChatroomId
1121 error:(EMError **_Nullable )pError;
1122
1148- (void)removeAdmin:(NSString *_Nonnull)aAdmin
1149 fromChatroom:(NSString *_Nonnull)aChatroomId
1150 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1151
1152
1182- (EMChatroom *_Nullable )muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
1183 muteMilliseconds:(NSInteger)aMuteMilliseconds
1184 fromChatroom:(NSString *_Nonnull)aChatroomId
1185 error:(EMError **_Nullable )pError;
1186
1213- (void)muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
1214 muteMilliseconds:(NSInteger)aMuteMilliseconds
1215 fromChatroom:(NSString *_Nonnull)aChatroomId
1216 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1217
1245- (EMChatroom *_Nullable )unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
1246 fromChatroom:(NSString *_Nonnull)aChatroomId
1247 error:(EMError **_Nullable )pError;
1248
1273- (void)unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
1274 fromChatroom:(NSString *_Nonnull)aChatroomId
1275 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1276
1277
1278
1304- (EMChatroom *_Nullable )muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1305 error:(EMError **_Nullable )pError;
1306
1329- (void)muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1330 completion:(void(^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1331
1332
1358- (EMChatroom *_Nullable )unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1359 error:(EMError **_Nullable )pError;
1360
1361
1384- (void)unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1385 completion:(void(^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1386
1387
1415- (EMChatroom *_Nullable )addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1416 fromChatroom:(NSString *_Nonnull)aChatroomId
1417 error:(EMError **_Nullable )pError;
1418
1443- (void)addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1444 fromChatroom:(NSString *_Nonnull)aChatroomId
1445 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1446
1474- (EMChatroom *_Nullable )removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1475 fromChatroom:(NSString *_Nonnull)aChatroomId
1476 error:(EMError **_Nullable )pError;
1477
1502- (void)removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1503 fromChatroom:(NSString *_Nonnull)aChatroomId
1504 completion:(void (^_Nullable )(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1505
1533- (EMChatroom *_Nullable )updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
1534 announcement:(NSString *_Nullable )aAnnouncement
1535 error:(EMError **_Nullable )pError;
1536
1561- (void)updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
1562 announcement:(NSString *_Nullable)aAnnouncement
1563 completion:(void (^_Nullable)(EMChatroom *_Nullable aChatroom, EMError *_Nullable aError))aCompletionBlock;
1596- (void)setChatroomAttributes:(NSString *_Nonnull)roomId attributes:(NSDictionary<NSString*,NSString*> *_Nonnull)keyValues autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,EMError*> *_Nullable failureKeys))completionBlock ;
1640- (void)setChatroomAttribute:(NSString *_Nonnull)roomId key:(NSString *_Nonnull)key value:(NSString *_Nonnull)value autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(EMError *_Nullable aError))completionBlock;
1666- (void)setChatroomAttributesForced:(NSString *_Nonnull)roomId attributes:(NSDictionary<NSString*,NSString*> *_Nonnull)keyValues autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,EMError*> *_Nullable failureKeys))completionBlock;
1667
1711- (void)setChatroomAttributeForced:(NSString *_Nonnull)roomId key:(NSString *_Nonnull)key value:(NSString *_Nonnull)value autoDelete:(BOOL)autoDelete completionBlock:(void (^_Nullable)(EMError *_Nullable aError))completionBlock;
1712
1739- (void)removeChatroomAttributes:(NSString *_Nonnull)roomId attributes:(NSArray <__kindof NSString*> * _Nonnull)keyValues completionBlock:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,EMError*> *_Nullable failureKeys))completionBlock;
1766- (void)removeChatroomAttribute:(NSString *_Nonnull)roomId key:(NSString * _Nonnull)key completionBlock:(void (^_Nullable)(EMError *_Nullable aError))completionBlock;
1793- (void)removeChatroomAttributesForced:(NSString *_Nonnull)roomId attributes:(NSArray <__kindof NSString*> * _Nonnull)keyValues completionBlock:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,EMError*> *_Nullable failureKeys))completionBlock;
1794
1821- (void)removeChatroomAttributeForced:(NSString *_Nonnull)roomId key:(NSString * _Nonnull)key completionBlock:(void (^_Nullable)(EMError *_Nullable aError))completionBlock;
1840- (void)fetchChatroomAttributes:(NSString *_Nonnull)roomId keys:(NSArray <__kindof NSString *> * _Nullable)keys completion:(void (^_Nullable)(EMError *_Nullable aError,NSDictionary<NSString*,NSString*> *_Nullable properties ))completionBlock;
1857- (void)fetchChatroomAllAttributes:(NSString * _Nonnull)roomId completion:(void (^ _Nullable)(EMError * _Nullable error,NSDictionary<NSString*,NSString*> * _Nullable properties))completionBlock;
1858
1859@end
Definition: EMChatroom.h:42
Definition: EMCursorResult.h:27
Definition: EMError.h:27
Definition: EMPageResult.h:24
Definition: EMChatroomManagerDelegate.h:41
Definition: IEMChatroomManager.h:34