HyphenateSDK  3.6.1
IEMChatroomManager.h
1 
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>)aDelegate
54  delegateQueue:(dispatch_queue_t)aQueue;
55 
67 - (void)removeDelegate:(id<EMChatroomManagerDelegate>)aDelegate;
68 
69 #pragma mark - Fetch Chatrooms
70 
94 - (EMPageResult *)getChatroomsFromServerWithPage:(NSInteger)aPageNum
95  pageSize:(NSInteger)aPageSize
96  error:(EMError **)pError;
97 
115 - (void)getChatroomsFromServerWithPage:(NSInteger)aPageNum
116  pageSize:(NSInteger)aPageSize
117  completion:(void (^)(EMPageResult *aResult, EMError *aError))aCompletionBlock;
118 
119 #pragma mark - Create
120 
150 - (EMChatroom *)createChatroomWithSubject:(NSString *)aSubject
151  description:(NSString *)aDescription
152  invitees:(NSArray *)aInvitees
153  message:(NSString *)aMessage
154  maxMembersCount:(NSInteger)aMaxMembersCount
155  error:(EMError **)pError;
156 
180 - (void)createChatroomWithSubject:(NSString *)aSubject
181  description:(NSString *)aDescription
182  invitees:(NSArray *)aInvitees
183  message:(NSString *)aMessage
184  maxMembersCount:(NSInteger)aMaxMembersCount
185  completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock;
186 
187 #pragma mark - Edit Chatroom
188 
210 - (EMChatroom *)joinChatroom:(NSString *)aChatroomId
211  error:(EMError **)pError;
212 
228 - (void)joinChatroom:(NSString *)aChatroomId
229  completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock;
230 
250 - (void)leaveChatroom:(NSString *)aChatroomId
251  error:(EMError **)pError;
252 
268 - (void)leaveChatroom:(NSString *)aChatroomId
269  completion:(void (^)(EMError *aError))aCompletionBlock;
270 
290 - (EMError *)destroyChatroom:(NSString *)aChatroomId;
291 
306 - (void)destroyChatroom:(NSString *)aChatroomId
307  completion:(void (^)(EMError *aError))aCompletionBlock;
308 
309 #pragma mark - Fetch
310 
332 - (EMChatroom *)getChatroomSpecificationFromServerWithId:(NSString *)aChatroomId
333  error:(EMError **)pError;
334 
349 - (void)getChatroomSpecificationFromServerWithId:(NSString *)aChatroomId
350  completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock;
351 
374 - (EMCursorResult *)getChatroomMemberListFromServerWithId:(NSString *)aChatroomId
375  cursor:(NSString *)aCursor
376  pageSize:(NSInteger)aPageSize
377  error:(EMError **)pError;
378 
398 - (void)getChatroomMemberListFromServerWithId:(NSString *)aChatroomId
399  cursor:(NSString *)aCursor
400  pageSize:(NSInteger)aPageSize
401  completion:(void (^)(EMCursorResult *aResult, EMError *aError))aCompletionBlock;
402 
422 - (NSArray *)getChatroomBlacklistFromServerWithId:(NSString *)aChatroomId
423  pageNumber:(NSInteger)aPageNum
424  pageSize:(NSInteger)aPageSize
425  error:(EMError **)pError;
426 
446 - (void)getChatroomBlacklistFromServerWithId:(NSString *)aChatroomId
447  pageNumber:(NSInteger)aPageNum
448  pageSize:(NSInteger)aPageSize
449  completion:(void (^)(NSArray *aList, EMError *aError))aCompletionBlock;
450 
470 - (NSArray *)getChatroomMuteListFromServerWithId:(NSString *)aChatroomId
471  pageNumber:(NSInteger)aPageNum
472  pageSize:(NSInteger)aPageSize
473  error:(EMError **)pError;
474 
494 - (void)getChatroomMuteListFromServerWithId:(NSString *)aChatroomId
495  pageNumber:(NSInteger)aPageNum
496  pageSize:(NSInteger)aPageSize
497  completion:(void (^)(NSArray *aList, EMError *aError))aCompletionBlock;
498 
516 - (NSString *)getChatroomAnnouncementWithId:(NSString *)aChatroomId
517  error:(EMError **)pError;
518 
534 - (void)getChatroomAnnouncementWithId:(NSString *)aChatroomId
535  completion:(void (^)(NSString *aAnnouncement, EMError *aError))aCompletionBlock;
536 
537 #pragma mark - Edit
538 
562 - (EMChatroom *)updateSubject:(NSString *)aSubject
563  forChatroom:(NSString *)aChatroomId
564  error:(EMError **)pError;
565 
583 - (void)updateSubject:(NSString *)aSubject
584  forChatroom:(NSString *)aChatroomId
585  completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock;
586 
610 - (EMChatroom *)updateDescription:(NSString *)aDescription
611  forChatroom:(NSString *)aChatroomId
612  error:(EMError **)pError;
613 
631 - (void)updateDescription:(NSString *)aDescription
632  forChatroom:(NSString *)aChatroomId
633  completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock;
634 
658 - (EMChatroom *)removeMembers:(NSArray *)aMembers
659  fromChatroom:(NSString *)aChatroomId
660  error:(EMError **)pError;
661 
679 - (void)removeMembers:(NSArray *)aMembers
680  fromChatroom:(NSString *)aChatroomId
681  completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock;
682 
706 - (EMChatroom *)blockMembers:(NSArray *)aMembers
707  fromChatroom:(NSString *)aChatroomId
708  error:(EMError **)pError;
709 
727 - (void)blockMembers:(NSArray *)aMembers
728  fromChatroom:(NSString *)aChatroomId
729  completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock;
730 
731 
755 - (EMChatroom *)unblockMembers:(NSArray *)aMembers
756  fromChatroom:(NSString *)aChatroomId
757  error:(EMError **)pError;
758 
776 - (void)unblockMembers:(NSArray *)aMembers
777  fromChatroom:(NSString *)aChatroomId
778  completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock;
779 
803 - (EMChatroom *)updateChatroomOwner:(NSString *)aChatroomId
804  newOwner:(NSString *)aNewOwner
805  error:(EMError **)pError;
806 
824 - (void)updateChatroomOwner:(NSString *)aChatroomId
825  newOwner:(NSString *)aNewOwner
826  completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock;
827 
851 - (EMChatroom *)addAdmin:(NSString *)aAdmin
852  toChatroom:(NSString *)aChatroomId
853  error:(EMError **)pError;
854 
872 - (void)addAdmin:(NSString *)aAdmin
873  toChatroom:(NSString *)aChatroomId
874  completion:(void (^)(EMChatroom *aChatroomp, EMError *aError))aCompletionBlock;
875 
899 - (EMChatroom *)removeAdmin:(NSString *)aAdmin
900  fromChatroom:(NSString *)aChatroomId
901  error:(EMError **)pError;
902 
920 - (void)removeAdmin:(NSString *)aAdmin
921  fromChatroom:(NSString *)aChatroomId
922  completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock;
923 
924 
950 - (EMChatroom *)muteMembers:(NSArray *)aMuteMembers
951  muteMilliseconds:(NSInteger)aMuteMilliseconds
952  fromChatroom:(NSString *)aChatroomId
953  error:(EMError **)pError;
954 
975 - (void)muteMembers:(NSArray *)aMuteMembers
976  muteMilliseconds:(NSInteger)aMuteMilliseconds
977  fromChatroom:(NSString *)aChatroomId
978  completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock;
979 
1003 - (EMChatroom *)unmuteMembers:(NSArray *)aMembers
1004  fromChatroom:(NSString *)aChatroomId
1005  error:(EMError **)pError;
1006 
1025 - (void)unmuteMembers:(NSArray *)aMembers
1026  fromChatroom:(NSString *)aChatroomId
1027  completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock;
1028 
1050 - (EMChatroom *)updateChatroomAnnouncementWithId:(NSString *)aChatroomId
1051  announcement:(NSString *)aAnnouncement
1052  error:(EMError **)pError;
1053 
1070 - (void)updateChatroomAnnouncementWithId:(NSString *)aChatroomId
1071  announcement:(NSString *)aAnnouncement
1072  completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock;
1073 
1074 #pragma mark - EM_DEPRECATED_IOS 3.3.0
1075 
1099 - (EMChatroom *)fetchChatroomInfo:(NSString *)aChatroomId
1100  includeMembersList:(BOOL)aIncludeMembersList
1101  error:(EMError **)pError EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -[IEMChatroomManager getChatroomSpecificationFromServerWithId:error:]");
1102 
1119 - (void)getChatroomSpecificationFromServerByID:(NSString *)aChatroomId
1120  includeMembersList:(BOOL)aIncludeMembersList
1121  completion:(void (^)(EMChatroom *aChatroom, EMError *aError))aCompletionBlock EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -[IEMChatroomManager getChatroomSpecificationFromServerWithId:completion:]");
1122 
1123 #pragma mark - EM_DEPRECATED_IOS 3.2.3
1124 
1136 - (void)addDelegate:(id<EMChatroomManagerDelegate>)aDelegate EM_DEPRECATED_IOS(3_1_0, 3_2_2, "Use -[IEMChatroomManager addDelegate:delegateQueue:]");
1137 
1138 #pragma mark - EM_DEPRECATED_IOS < 3.2.3
1139 
1159 - (NSArray *)getAllChatroomsFromServerWithError:(EMError **)pError __deprecated_msg("Use -getChatroomsFromServerWithPage");
1160 
1173 - (void)getAllChatroomsFromServerWithCompletion:(void (^)(NSArray *aList, EMError *aError))aCompletionBlock __deprecated_msg("Use -getChatroomsFromServerWithPage");
1174 
1189 - (void)asyncGetAllChatroomsFromServer:(void (^)(NSArray *aList))aSuccessBlock
1190  failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -getAllChatroomsFromServerWithCompletion:");
1191 
1209 - (void)asyncJoinChatroom:(NSString *)aChatroomId
1210  success:(void (^)(EMChatroom *aRoom))aSuccessBlock
1211  failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -joinChatroom:completion:");
1212 
1232 - (void)asyncLeaveChatroom:(NSString *)aChatroomId
1233  success:(void (^)(EMChatroom *aRoom))aSuccessBlock
1234  failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -leaveChatroom:completion:");
1235 
1254 - (void)asyncFetchChatroomInfo:(NSString *)aChatroomId
1255  includeMembersList:(BOOL)aIncludeMembersList
1256  success:(void (^)(EMChatroom *aChatroom))aSuccessBlock
1257  failure:(void (^)(EMError *aError))aFailureBlock __deprecated_msg("Use -getChatroomSpecificationFromServerByID:includeMembersList:completion:");
1258 @end
Definition: EMChatroomManagerDelegate.h:39
Definition: EMError.h:26
Definition: EMPageResult.h:24
Definition: EMChatroom.h:41
Definition: EMCursorResult.h:24
Definition: IEMChatroomManager.h:34