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;
269- (void)joinChatroom:(NSString *_Nonnull)aChatroomId
270 ext:(NSString* _Nullable)ext
271 leaveOtherRooms:(BOOL)leaveOtherRooms
272 completion:(
void (^_Nullable)(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
293- (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
294 error:(
EMError **_Nullable)pError;
315- (void)leaveChatroom:(NSString *_Nonnull)aChatroomId
316 completion:(
void (^_Nullable)(
EMError *_Nullable aError))aCompletionBlock;
343- (
EMError *_Nullable)destroyChatroom:(NSString *_Nonnull)aChatroomId;
367- (void)destroyChatroom:(NSString *_Nonnull)aChatroomId
368 completion:(
void (^_Nullable)(
EMError * _Nullable aError))aCompletionBlock;
393- (
EMChatroom *_Nullable)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
394 error:(
EMError *_Nullable*)pError;
414- (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
415 completion:(
void (^_Nullable)(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
437- (void)getChatroomSpecificationFromServerWithId:(NSString *_Nonnull)aChatroomId
438 fetchMembers:(
bool)aFetchMembers
439 completion:(
void (^_Nullable)(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
467- (
EMCursorResult<NSString*> *_Nullable)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
468 cursor:(NSString *_Nullable)aCursor
469 pageSize:(NSInteger)aPageSize
470 error:(
EMError **_Nullable)pError;
495- (void)getChatroomMemberListFromServerWithId:(NSString *_Nonnull)aChatroomId
496 cursor:(NSString *_Nullable)aCursor
497 pageSize:(NSInteger)aPageSize
498 completion:(
void (^_Nullable)(
EMCursorResult<NSString*> *_Nullable aResult,
EMError *_Nullable aError))aCompletionBlock;
527- (NSArray<NSString *> *_Nullable)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
528 pageNumber:(NSInteger)aPageNum
529 pageSize:(NSInteger)aPageSize
530 error:(
EMError **_Nullable)pError;
559- (void)getChatroomBlacklistFromServerWithId:(NSString *_Nonnull)aChatroomId
560 pageNumber:(NSInteger)aPageNum
561 pageSize:(NSInteger)aPageSize
562 completion:(
void (^_Nullable)(NSArray<NSString *> *_Nullable aList,
EMError *_Nullable aError))aCompletionBlock;
591- (NSArray<NSString *> *_Nullable)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
592 pageNumber:(NSInteger)aPageNum
593 pageSize:(NSInteger)aPageSize
594 error:(
EMError **_Nullable)pError;
623- (void)getChatroomMuteListFromServerWithId:(NSString *_Nonnull)aChatroomId
624 pageNumber:(NSInteger)aPageNum
625 pageSize:(NSInteger)aPageSize
626 completion:(
void (^_Nullable)(NSArray<NSString *> *_Nullable aList,
EMError *_Nullable aError))aCompletionBlock;
652- (NSArray<NSString *> *_Nullable)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
653 error:(
EMError **_Nullable)pError;
679- (void)getChatroomWhiteListFromServerWithId:(NSString *_Nonnull)aChatroomId
680 completion:(
void (^_Nullable)(NSArray<NSString *> *_Nullable aList,
EMError *_Nullable aError))aCompletionBlock;
701- (BOOL)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
702 error:(
EMError **_Nullable )pError;
723- (void)isMemberInWhiteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
724 completion:(
void (^_Nullable)(BOOL inWhiteList,
EMError *_Nullable aError))aCompletionBlock;
745- (void)isMemberInMuteListFromServerWithChatroomId:(NSString *_Nonnull)aChatroomId
746 completion:(
void (^_Nullable)(BOOL inMuteList,
EMError *_Nullable aError))aCompletionBlock;
768- (NSString *_Nullable)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
769 error:(
EMError **_Nullable )pError;
789- (void)getChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
790 completion:(
void (^_Nullable)(NSString *_Nullable aAnnouncement,
EMError *_Nullable aError))aCompletionBlock;
821- (
EMChatroom *)updateSubject:(NSString *_Nullable )aSubject
822 forChatroom:(NSString *_Nonnull)aChatroomId
823 error:(
EMError **_Nullable )pError;
850- (void)updateSubject:(NSString *_Nullable )aSubject
851 forChatroom:(NSString *_Nonnull)aChatroomId
852 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
881- (
EMChatroom *_Nullable )updateDescription:(NSString *_Nullable )aDescription
882 forChatroom:(NSString *_Nonnull)aChatroomId
883 error:(
EMError **_Nullable )pError;
910- (void)updateDescription:(NSString *_Nullable )aDescription
911 forChatroom:(NSString *_Nonnull)aChatroomId
912 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
941- (
EMChatroom *_Nullable )removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
942 fromChatroom:(NSString *_Nonnull)aChatroomId
943 error:(
EMError **_Nullable )pError;
970- (void)removeMembers:(NSArray<NSString *> *_Nonnull)aMembers
971 fromChatroom:(NSString *_Nonnull)aChatroomId
972 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1001- (
EMChatroom *_Nullable )blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
1002 fromChatroom:(NSString *_Nonnull)aChatroomId
1003 error:(
EMError **_Nullable )pError;
1030- (void)blockMembers:(NSArray<NSString *> *_Nonnull)aMembers
1031 fromChatroom:(NSString *_Nonnull)aChatroomId
1032 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1062- (
EMChatroom *_Nullable )unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
1063 fromChatroom:(NSString *_Nonnull)aChatroomId
1064 error:(
EMError **_Nullable )pError;
1091- (void)unblockMembers:(NSArray<NSString *> *_Nonnull)aMembers
1092 fromChatroom:(NSString *_Nonnull)aChatroomId
1093 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1122- (
EMChatroom *_Nullable )updateChatroomOwner:(NSString *_Nonnull)aChatroomId
1123 newOwner:(NSString *_Nonnull)aNewOwner
1124 error:(
EMError **_Nullable )pError;
1151- (void)updateChatroomOwner:(NSString *_Nonnull)aChatroomId
1152 newOwner:(NSString *_Nonnull)aNewOwner
1153 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1182- (
EMChatroom *_Nullable )addAdmin:(NSString *_Nonnull)aAdmin
1183 toChatroom:(NSString *_Nonnull)aChatroomId
1184 error:(
EMError **_Nullable )pError;
1211- (void)addAdmin:(NSString *_Nonnull)aAdmin
1212 toChatroom:(NSString *_Nonnull)aChatroomId
1213 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroomp,
EMError *_Nullable aError))aCompletionBlock;
1242- (
EMChatroom *_Nullable )removeAdmin:(NSString *_Nonnull)aAdmin
1243 fromChatroom:(NSString *_Nonnull)aChatroomId
1244 error:(
EMError **_Nullable )pError;
1271- (void)removeAdmin:(NSString *_Nonnull)aAdmin
1272 fromChatroom:(NSString *_Nonnull)aChatroomId
1273 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1305- (
EMChatroom *_Nullable )muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
1306 muteMilliseconds:(NSInteger)aMuteMilliseconds
1307 fromChatroom:(NSString *_Nonnull)aChatroomId
1308 error:(
EMError **_Nullable )pError;
1336- (void)muteMembers:(NSArray<NSString *> *_Nonnull)aMuteMembers
1337 muteMilliseconds:(NSInteger)aMuteMilliseconds
1338 fromChatroom:(NSString *_Nonnull)aChatroomId
1339 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1368- (
EMChatroom *_Nullable )unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
1369 fromChatroom:(NSString *_Nonnull)aChatroomId
1370 error:(
EMError **_Nullable )pError;
1396- (void)unmuteMembers:(NSArray<NSString *> *_Nonnull)aMembers
1397 fromChatroom:(NSString *_Nonnull)aChatroomId
1398 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1427- (
EMChatroom *_Nullable )muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1428 error:(
EMError **_Nullable )pError;
1452- (void)muteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1453 completion:(
void(^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1481- (
EMChatroom *_Nullable )unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1482 error:(
EMError **_Nullable )pError;
1507- (void)unmuteAllMembersFromChatroom:(NSString *_Nonnull)aChatroomId
1508 completion:(
void(^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1538- (
EMChatroom *_Nullable )addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1539 fromChatroom:(NSString *_Nonnull)aChatroomId
1540 error:(
EMError **_Nullable )pError;
1566- (void)addWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1567 fromChatroom:(NSString *_Nonnull)aChatroomId
1568 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1597- (
EMChatroom *_Nullable )removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1598 fromChatroom:(NSString *_Nonnull)aChatroomId
1599 error:(
EMError **_Nullable )pError;
1625- (void)removeWhiteListMembers:(NSArray<NSString *> *_Nonnull)aMembers
1626 fromChatroom:(NSString *_Nonnull)aChatroomId
1627 completion:(
void (^_Nullable )(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1656- (
EMChatroom *_Nullable )updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
1657 announcement:(NSString *_Nullable )aAnnouncement
1658 error:(
EMError **_Nullable )pError;
1684- (void)updateChatroomAnnouncementWithId:(NSString *_Nonnull)aChatroomId
1685 announcement:(NSString *_Nullable)aAnnouncement
1686 completion:(
void (^_Nullable)(
EMChatroom *_Nullable aChatroom,
EMError *_Nullable aError))aCompletionBlock;
1719- (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 ;
1763- (void)setChatroomAttribute:(NSString *_Nonnull)roomId key:(NSString *_Nonnull)key value:(NSString *_Nonnull)value autoDelete:(BOOL)autoDelete completionBlock:(
void (^_Nullable)(
EMError *_Nullable aError))completionBlock;
1789- (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;
1834- (void)setChatroomAttributeForced:(NSString *_Nonnull)roomId key:(NSString *_Nonnull)key value:(NSString *_Nonnull)value autoDelete:(BOOL)autoDelete completionBlock:(
void (^_Nullable)(
EMError *_Nullable aError))completionBlock;
1862- (void)removeChatroomAttributes:(NSString *_Nonnull)roomId attributes:(NSArray <__kindof NSString*> * _Nonnull)keyValues completionBlock:(
void (^_Nullable)(
EMError *_Nullable aError,NSDictionary<NSString*,
EMError*> *_Nullable failureKeys))completionBlock;
1889- (void)removeChatroomAttribute:(NSString *_Nonnull)roomId key:(NSString * _Nonnull)key completionBlock:(
void (^_Nullable)(
EMError *_Nullable aError))completionBlock;
1916- (void)removeChatroomAttributesForced:(NSString *_Nonnull)roomId attributes:(NSArray <__kindof NSString*> * _Nonnull)keyValues completionBlock:(
void (^_Nullable)(
EMError *_Nullable aError,NSDictionary<NSString*,
EMError*> *_Nullable failureKeys))completionBlock;
1944- (void)removeChatroomAttributeForced:(NSString *_Nonnull)roomId key:(NSString * _Nonnull)key completionBlock:(
void (^_Nullable)(
EMError *_Nullable aError))completionBlock;
1963- (void)fetchChatroomAttributes:(NSString *_Nonnull)roomId keys:(NSArray <__kindof NSString *> * _Nullable)keys completion:(
void (^_Nullable)(
EMError *_Nullable aError,NSDictionary<NSString*,NSString*> *_Nullable properties ))completionBlock;
1980- (void)fetchChatroomAllAttributes:(NSString * _Nonnull)roomId completion:(
void (^ _Nullable)(
EMError * _Nullable error,NSDictionary<NSString*,NSString*> * _Nullable properties))completionBlock;
1982#pragma mark - EM_DEPRECATED_IOS 3.3.0
2011- (
EMChatroom *)fetchChatroomInfo:(NSString *)aChatroomId
2012 includeMembersList:(BOOL)aIncludeMembersList
2013 error:(
EMError **)pError EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -
IEMChatroomManager getChatroomSpecificationFromServerWithId:error: instead");
2035- (void)getChatroomSpecificationFromServerByID:(NSString *)aChatroomId
2036 includeMembersList:(BOOL)aIncludeMembersList
2037 completion:(
void (^)(
EMChatroom *aChatroom,
EMError *aError))aCompletionBlock EM_DEPRECATED_IOS(3_1_0, 3_3_0, "Use -
IEMChatroomManager getChatroomSpecificationFromServerWithId:completion: instead");
2039#pragma mark - EM_DEPRECATED_IOS 3.2.3
2058#pragma mark - EM_DEPRECATED_IOS < 3.2.3
2083- (NSArray *)getAllChatroomsFromServerWithError:(
EMError **)pError __deprecated_msg("Use -getChatroomsFromServerWithPage instead");
2101- (void)getAllChatroomsFromServerWithCompletion:(
void (^)(NSArray *aList,
EMError *aError))aCompletionBlock __deprecated_msg("Use -getChatroomsFromServerWithPage instead");
2121- (void)asyncGetAllChatroomsFromServer:(
void (^)(NSArray *aList))aSuccessBlock
2122 failure:(
void (^)(
EMError *aError))aFailureBlock __deprecated_msg("Use -getAllChatroomsFromServerWithCompletion: instead");
2145- (void)asyncJoinChatroom:(NSString *)aChatroomId
2146 success:(
void (^)(
EMChatroom *aRoom))aSuccessBlock
2147 failure:(
void (^)(
EMError *aError))aFailureBlock __deprecated_msg("Use -joinChatroom:completion: instead");
2172- (void)asyncLeaveChatroom:(NSString *)aChatroomId
2173 success:(
void (^)(
EMChatroom *aRoom))aSuccessBlock
2174 failure:(
void (^)(
EMError *aError))aFailureBlock __deprecated_msg("Use -leaveChatroom:completion: instead");
2198- (void)asyncFetchChatroomInfo:(NSString *)aChatroomId
2199 includeMembersList:(BOOL)aIncludeMembersList
2200 success:(
void (^)(
EMChatroom *aChatroom))aSuccessBlock
2201 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