15#import <Foundation/Foundation.h>
17#import "EMCommonDefs.h"
18#import "EMChatroomManagerDelegate.h"
19#import "EMChatroomOptions.h"
21#import "EMPageResult.h"
23#import "EMCursorResult.h"
38#pragma mark - Delegate
54 delegateQueue:(dispatch_queue_t _Nullable)aQueue;
69#pragma mark - Fetch Chatrooms
95 pageSize:(NSInteger)aPageSize
96 error:(
EMError **_Nullable)pError;
119- (void)getChatroomsFromServerWithPage:(NSInteger)aPageNum
120 pageSize:(NSInteger)aPageSize
154- (
EMChatroom *_Nullable)createChatroomWithSubject:(NSString *_Nullable)aSubject
155 description:(NSString *_Nullable)aDescription
156 invitees:(NSArray<NSString *> *_Nullable)aInvitees
157 message:(NSString *_Nullable)aMessage
158 maxMembersCount:(NSInteger)aMaxMembersCount
159 error:(
EMError **_Nullable)pError;
188- (void)createChatroomWithSubject:(NSString *_Nullable)aSubject
189 description:(NSString *_Nullable)aDescription
190 invitees:(NSArray<NSString *> *_Nullable)aInvitees
191 message:(NSString *_Nullable)aMessage
192 maxMembersCount:(NSInteger)aMaxMembersCount
193 completion:(
void (^_Nullable)(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
195#pragma mark - Edit Chatroom
218- (
EMChatroom *)joinChatroom:(NSString * _Nonnull)aChatroomId
219 error:(
EMError ** _Nullable)pError;
240- (void)joinChatroom:(NSString *_Nonnull)aChatroomId
241 completion:(
void (^_Nullable)(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
262- (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
263 error:(
EMError **_Nullable)pError;
284- (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
285 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
312- (
EMError *_Nullable)destroyChatroom:(NSString *_Nonnull)aChatroomId;
336- (void)destroyChatroom:(NSString *_Nonnull)aChatroomId
337 completion:(
void (^_Nullable)(
EMError * _Nullable aError))aCompletionBlock;
362- (
EMChatroom *_Nullable)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
363 error:(
EMError *_Nullable*)pError;
383- (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
384 completion:(
void (^_Nullable)(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
406- (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
407 fetchMembers:(
bool)aFetchMembers
408 completion:(
void (^_Nullable)(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
436- (
EMCursorResult<NSString*> *_Nullable)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
437 cursor:(NSString *_Nullable)aCursor
438 pageSize:(NSInteger)aPageSize
439 error:(
EMError **_Nullable)pError;
464- (void)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
465 cursor:(NSString *_Nullable)aCursor
466 pageSize:(NSInteger)aPageSize
467 completion:(
void (^_Nullable)(
EMCursorResult<NSString*> *_Nullable aResult,
EMError *_Nullable aError))aCompletionBlock;
496- (NSArray<NSString *> *_Nullable)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
497 pageNumber:(NSInteger)aPageNum
498 pageSize:(NSInteger)aPageSize
499 error:(
EMError **_Nullable)pError;
528- (void)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
529 pageNumber:(NSInteger)aPageNum
530 pageSize:(NSInteger)aPageSize
531 completion:(
void (^_Nullable)(NSArray<NSString *> *_Nullable aList,
EMError *_Nullable aError))aCompletionBlock;
560- (NSArray<NSString *> *_Nullable)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
561 pageNumber:(NSInteger)aPageNum
562 pageSize:(NSInteger)aPageSize
563 error:(
EMError **_Nullable)pError;
592- (void)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
593 pageNumber:(NSInteger)aPageNum
594 pageSize:(NSInteger)aPageSize
595 completion:(
void (^_Nullable)(NSArray<NSString *> *_Nullable aList,
EMError *_Nullable aError))aCompletionBlock;
621- (NSArray<NSString *> *_Nullable)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
622 error:(
EMError **_Nullable)pError;
648- (void)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
649 completion:(
void (^_Nullable)(NSArray<NSString *> *_Nullable aList,
EMError *_Nullable aError))aCompletionBlock;
670- (BOOL)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
671 error:(
EMError **_Nullable )pError;
692- (void)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
693 completion:(
void (^_Nullable)(BOOL inWhiteList,
EMError *_Nullable aError))aCompletionBlock;
715- (NSString *_Nullable)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
716 error:(
EMError **_Nullable )pError;
736- (void)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
737 completion:(
void (^_Nullable)(NSString *_Nullable aAnnouncement,
EMError *_Nullable aError))aCompletionBlock;
768- (
EMChatroom *)updateSubject:(NSString *_Nullable )aSubject
769 forChatroom:(NSString *_Nonnull)aChatroomId
770 error:(
EMError **_Nullable )pError;
797- (void)updateSubject:(NSString *_Nullable )aSubject
798 forChatroom:(NSString *_Nonnull)aChatroomId
799 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
828- (
EMChatroom *_Nullable )updateDescription:(NSString *_Nullable )aDescription
829 forChatroom:(NSString *_Nonnull)aChatroomId
830 error:(
EMError **_Nullable )pError;
857- (void)updateDescription:(NSString *_Nullable )aDescription
858 forChatroom:(NSString *_Nonnull)aChatroomId
859 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
888- (
EMChatroom *_Nullable )removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
889 fromChatroom:(NSString *_Nonnull)aChatroomId
890 error:(
EMError **_Nullable )pError;
917- (void)removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
918 fromChatroom:(NSString *_Nonnull)aChatroomId
919 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
948- (
EMChatroom *_Nullable )blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
949 fromChatroom:(NSString *_Nonnull)aChatroomId
950 error:(
EMError **_Nullable )pError;
977- (void)blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
978 fromChatroom:(NSString *_Nonnull)aChatroomId
979 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1009- (
EMChatroom *_Nullable )unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
1010 fromChatroom:(NSString *_Nonnull)aChatroomId
1011 error:(
EMError **_Nullable )pError;
1038- (void)unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
1039 fromChatroom:(NSString *_Nonnull)aChatroomId
1040 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1069- (
EMChatroom *_Nullable )updateChatroomOwner:(NSString *_Nonnull)aChatroomId
1070 newOwner:(NSString *_Nonnull)aNewOwner
1071 error:(
EMError **_Nullable )pError;
1098- (void)updateChatroomOwner:(NSString *_Nonnull)aChatroomId
1099 newOwner:(NSString *_Nonnull)aNewOwner
1100 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1129- (
EMChatroom *_Nullable )addAdmin:(NSString *_Nonnull)aAdmin
1130 toChatroom:(NSString *_Nonnull)aChatroomId
1131 error:(
EMError **_Nullable )pError;
1158- (void)addAdmin:(NSString *_Nonnull)aAdmin
1159 toChatroom:(NSString *_Nonnull)aChatroomId
1160 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroomp,
EMError *_Nullable aError))aCompletionBlock;
1189- (
EMChatroom *_Nullable )removeAdmin:(NSString *_Nonnull)aAdmin
1190 fromChatroom:(NSString *_Nonnull)aChatroomId
1191 error:(
EMError **_Nullable )pError;
1218- (void)removeAdmin:(NSString *_Nonnull)aAdmin
1219 fromChatroom:(NSString *_Nonnull)aChatroomId
1220 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1252- (
EMChatroom *_Nullable )muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
1253 muteMilliseconds:(NSInteger)aMuteMilliseconds
1254 fromChatroom:(NSString *_Nonnull)aChatroomId
1255 error:(
EMError **_Nullable )pError;
1283- (void)muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
1284 muteMilliseconds:(NSInteger)aMuteMilliseconds
1285 fromChatroom:(NSString *_Nonnull)aChatroomId
1286 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1315- (
EMChatroom *_Nullable )unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
1316 fromChatroom:(NSString *_Nonnull)aChatroomId
1317 error:(
EMError **_Nullable )pError;
1343- (void)unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
1344 fromChatroom:(NSString *_Nonnull)aChatroomId
1345 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1374- (
EMChatroom *_Nullable )muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1375 error:(
EMError **_Nullable )pError;
1399- (void)muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1400 completion:(
void(^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1428- (
EMChatroom *_Nullable )unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1429 error:(
EMError **_Nullable )pError;
1454- (void)unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1455 completion:(
void(^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1485- (
EMChatroom *_Nullable )addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1486 fromChatroom:(NSString *_Nonnull)aChatroomId
1487 error:(
EMError **_Nullable )pError;
1513- (void)addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1514 fromChatroom:(NSString *_Nonnull)aChatroomId
1515 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1544- (
EMChatroom *_Nullable )removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1545 fromChatroom:(NSString *_Nonnull)aChatroomId
1546 error:(
EMError **_Nullable )pError;
1572- (void)removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1573 fromChatroom:(NSString *_Nonnull)aChatroomId
1574 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1603- (
EMChatroom *_Nullable )updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
1604 announcement:(NSString *_Nullable )aAnnouncement
1605 error:(
EMError **_Nullable )pError;
1631- (void)updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
1632 announcement:(NSString *_Nullable)aAnnouncement
1633 completion:(
void (^_Nullable)(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1666- (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 ;
1710- (void)setChatroomAttribute:(NSString *_Nonnull)roomId key:(NSString *_Nonnull)key value:(NSString *_Nonnull)value autoDelete:(BOOL)autoDelete completionBlock:(
void (^_Nullable)(
EMError *_Nullable aError))completionBlock;
1736- (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;
1781- (void)setChatroomAttributeForced:(NSString *_Nonnull)roomId key:(NSString *_Nonnull)key value:(NSString *_Nonnull)value autoDelete:(BOOL)autoDelete completionBlock:(
void (^_Nullable)(
EMError *_Nullable aError))completionBlock;
1809- (void)removeChatroomAttributes:(NSString *_Nonnull)roomId attributes:(NSArray <__kindof NSString*> * _Nonnull)keyValues completionBlock:(
void (^_Nullable)(
EMError *_Nullable aError,NSDictionary<NSString*,
EMError*> *_Nullable failureKeys))completionBlock;
1836- (void)removeChatroomAttribute:(NSString *_Nonnull)roomId key:(NSString * _Nonnull)key completionBlock:(
void (^_Nullable)(
EMError *_Nullable aError))completionBlock;
1863- (void)removeChatroomAttributesForced:(NSString *_Nonnull)roomId attributes:(NSArray <__kindof NSString*> * _Nonnull)keyValues completionBlock:(
void (^_Nullable)(
EMError *_Nullable aError,NSDictionary<NSString*,
EMError*> *_Nullable failureKeys))completionBlock;
1891- (void)removeChatroomAttributeForced:(NSString *_Nonnull)roomId key:(NSString * _Nonnull)key completionBlock:(
void (^_Nullable)(
EMError *_Nullable aError))completionBlock;
1910- (void)fetchChatroomAttributes:(NSString *_Nonnull)roomId keys:(NSArray <__kindof NSString *> * _Nullable)keys completion:(
void (^_Nullable)(
EMError *_Nullable aError,NSDictionary<NSString*,NSString*> *_Nullable properties ))completionBlock;
1927- (void)fetchChatroomAllAttributes:(NSString * _Nonnull)roomId completion:(
void (^ _Nullable)(
EMError * _Nullable error,NSDictionary<NSString*,NSString*> * _Nullable properties))completionBlock;
1929#pragma mark - EM_DEPRECATED_IOS 3.3.0
1958- (
EMChatroom *)fetchChatroomInfo:(NSString *)aChatroomId
1959 includeMembersList:(BOOL)aIncludeMembersList
1960 error:(
EMError **)pError EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -
IEMChatroomManager getChatroomSpecificationFromServerWithId:error: instead");
1982- (void)getChatroomSpecificationFromServerByID:(NSString *)aChatroomId
1983 includeMembersList:(BOOL)aIncludeMembersList
1984 completion:(
void (^)(
EMChatroom *aChatroom,
EMError *aError))aCompletionBlock EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -
IEMChatroomManager getChatroomSpecificationFromServerWithId:completion: instead");
1986#pragma mark - EM_DEPRECATED_IOS 3.2.3
2005#pragma mark - EM_DEPRECATED_IOS < 3.2.3
2030- (NSArray *)getAllChatroomsFromServerWithError:(
EMError **)pError __deprecated_msg("Use -getChatroomsFromServerWithPage instead");
2048- (void)getAllChatroomsFromServerWithCompletion:(
void (^)(NSArray *aList,
EMError *aError))aCompletionBlock __deprecated_msg("Use -getChatroomsFromServerWithPage instead");
2068- (void)asyncGetAllChatroomsFromServer:(
void (^)(NSArray *aList))aSuccessBlock
2069 failure:(
void (^)(
EMError *aError))aFailureBlock __deprecated_msg("Use -getAllChatroomsFromServerWithCompletion: instead");
2092- (void)asyncJoinChatroom:(NSString *)aChatroomId
2093 success:(
void (^)(
EMChatroom *aRoom))aSuccessBlock
2094 failure:(
void (^)(
EMError *aError))aFailureBlock __deprecated_msg("Use -joinChatroom:completion: instead");
2119- (void)asyncLeaveChatroom:(NSString *)aChatroomId
2120 success:(
void (^)(
EMChatroom *aRoom))aSuccessBlock
2121 failure:(
void (^)(
EMError *aError))aFailureBlock __deprecated_msg("Use -leaveChatroom:completion: instead");
2145- (void)asyncFetchChatroomInfo:(NSString *)aChatroomId
2146 includeMembersList:(BOOL)aIncludeMembersList
2147 success:(
void (^)(
EMChatroom *aChatroom))aSuccessBlock
2148 failure:(
void (^)(
EMError *aError))aFailureBlock __deprecated_msg("Use -getChatroomSpecificationFromServerByID:includeMembersList:completion: instead");
Definition: EMChatroom.h:42
Definition: EMCursorResult.h:27
Definition: EMPageResult.h:24
Definition: EMChatroomManagerDelegate.h:41
Definition: IEMChatroomManager.h:34