HyphenateChatSDK 3.9.9.1
IEMCircleManager.h
1//
2// IEMCircleManager.h
3// HyphenateChat
4//
5// Created by 冯钊 on 2022/6/14.
6// Copyright © 2022 easemob.com. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11#import "EMError.h"
12#import "EMCircleUser.h"
13#import "EMCircleServer.h"
14#import "EMCircleChannel.h"
15#import "EMCircleManagerServerDelegate.h"
16#import "EMCircleManagerChannelDelegate.h"
17#import "EMCursorResult.h"
18#import "EMCircleServerAttribute.h"
19#import "EMCircleChannelAttribute.h"
20#import "EMCircleCategory.h"
21#import "EMCircleVoiceChannel.h"
22#import "EMCircleManagerCategoryDelegate.h"
29typedef NS_ENUM(NSUInteger, EMCircleServerSearchType) {
30 EMCircleServerSearchTypeName,
31 EMCircleServerSearchTypeTag,
32};
33
34NS_ASSUME_NONNULL_BEGIN
35
36@protocol IEMCircleManager <NSObject>
37
38@required
46- (void)addServerDelegate:(id<EMCircleManagerServerDelegate>)delegate
47 queue:(nullable dispatch_queue_t)queue NS_SWIFT_NAME(add(serverDelegate:queue:));
54- (void)removeServerDelegate:(id<EMCircleManagerServerDelegate>)delegate NS_SWIFT_NAME(remove(serverDelegate:));
55
63- (void)addChannelDelegate:(id<EMCircleManagerChannelDelegate>)delegate
64 queue:(nullable dispatch_queue_t)queue NS_SWIFT_NAME(add(channelDelegate:queue:));
65
72- (void)removeChannelDelegate:(id<EMCircleManagerChannelDelegate>)delegate NS_SWIFT_NAME(remove(channelDelegate:));
73
81- (void)addCategoryDelegate:(id<EMCircleManagerCategoryDelegate>)delegate queue:(nullable dispatch_queue_t)queue NS_SWIFT_NAME(add(categoryDelegate:queue:));
82
89- (void)removeCategoryDelegate:(id<EMCircleManagerCategoryDelegate>)delegate NS_SWIFT_NAME(remove(categoryDelegate:));
90#pragma mark - server
98- (void)createServer:(EMCircleServerAttribute *)attribute completion:(void(^)(EMCircleServer * _Nullable server, EMError * _Nullable error))completion;
99
109- (void)destroyServer:(NSString *)serverId completion:(void(^)(EMError * _Nullable error))completion;
110
121- (void)updateServer:(NSString *)serverId attribute:(EMCircleServerAttribute *)attribute completion:(void(^)(EMCircleServer * _Nullable server, EMError * _Nullable error))completion;
122
130- (void)joinServer:(NSString *)serverId completion:(void(^)(EMCircleServer * _Nullable server, EMError * _Nullable error))completion;
131
143- (void)leaveServer:(NSString *)serverId completion:(void(^)(EMError * _Nullable error))completion;
144
155- (void)removeUserFromServer:(NSString *)serverId userId:(NSString *)userId completion:(void(^)(EMError * _Nullable error))completion;
156
165- (void)inviteUserToServer:(NSString *)serverId userId:(NSString *)userId welcome:(nullable NSString *)welcome completion:(void(^)(EMError * _Nullable error))completion NS_SWIFT_NAME(inviteUserToServer(serverId:userId:welcome:completion:));;
166
175- (void)acceptServerInvitation:(NSString *)serverId inviter:(NSString *)invite completion:(void(^)(EMCircleServer * _Nullable server, EMError * _Nullable error))completion;
176
185- (void)declineServerInvitation:(NSString *)serverId inviter:(NSString *)invite completion:(void(^)(EMError * _Nullable error))completion;
186
197- (void)addTagsToServer:(NSString *)serverId tags:(NSArray<NSString *> *)tags completion:(void(^)(NSArray<EMCircleServerTag *> * _Nullable tags, EMError * _Nullable error))completion;
198
209- (void)removeTagsFromServer:(NSString *)serverId tagIds:(NSArray <NSString *>*)tagIds completion:(void(^)(EMError * _Nullable error))completion;
210
221- (void)addModeratorToServer:(NSString *)serverId userId:(NSString *)userId completion:(void(^)(EMError * _Nullable error))completion;
222
233- (void)removeModeratorFromServer:(NSString *)serverId userId:(NSString *)userId completion:(void(^)(EMError * _Nullable error))completion;
234
242- (void)fetchSelfServerRole:(NSString *)serverId completion:(void(^)(EMCircleUserRole role, EMError * _Nullable error))completion;
243
254- (void)fetchJoinedServers:(NSUInteger)limit cursor:(nullable NSString *)cursor completion:(void(^)(EMCursorResult<EMCircleServer *> * _Nullable result, EMError * _Nullable error))completion;
255
263- (void)fetchServerDetail:(NSString *)serverId completion:(void(^)(EMCircleServer * _Nullable server, EMError * _Nullable error))completion;
264
272- (void)fetchServersWithKeyword:(NSString *)keyword completion:(void (^)(NSArray<EMCircleServer *> * _Nullable result, EMError * _Nullable error))completion;
273
289- (void)fetchServersWithType:(EMCircleServerSearchType)type keyword:(NSString *)keyword limit:(NSUInteger)limit cursor:(nullable NSString *)cursor completion:(void (^)(EMCursorResult<EMCircleServer *> * _Nullable result, EMError * _Nullable error))completion;
290
302- (void)fetchServerMembers:(NSString *)serverId limit:(NSUInteger)limit cursor:(nullable NSString *)cursor completion:(void(^)(EMCursorResult<EMCircleUser *> * _Nullable result, EMError * _Nullable error))completion;
303
311- (void)checkSelfIsInServer:(NSString *)serverId completion:(void(^)(BOOL isJoined, EMError * _Nullable error))completion;
312
320- (void)fetchServerTags:(NSString *)serverId completion:(void(^)(NSArray<EMCircleServerTag *> * _Nullable result, EMError * _Nullable error))completion;
321
322#pragma mark - channel
335- (void)createChannel:(NSString *)serverId categoryId:(nullable NSString *)categoryId attribute:(EMCircleChannelAttribute *)attribute mode:(EMCircleChannelMode)mode completion:(void(^)(EMCircleChannel * _Nullable channel, EMError * _Nullable error))completion;
336
347- (void)destroyChannel:(NSString *)serverId channelId:(NSString *)channelId completion:(void(^)(EMError * _Nullable error))completion;
348
360- (void)updateChannel:(NSString *)serverId channelId:(NSString *)channelId attribute:(EMCircleChannelAttribute *)attribute completion:(void(^)(EMCircleChannel * _Nullable channel, EMError * _Nullable error))completion;
361
370- (void)joinChannel:(NSString *)serverId channelId:(NSString *)channelId completion:(void(^)(EMCircleChannel * _Nullable channel, EMError * _Nullable error))completion;
371
384- (void)leaveChannel:(NSString *)serverId channelId:(NSString *)channelId completion:(void(^)(EMError * _Nullable error))completion;
385
399- (void)removeUserFromChannel:(NSString *)serverId channelId:(NSString *)channelId userId:(NSString *)userId completion:(void(^)(EMError * _Nullable error))completion;
400
410- (void)inviteUserToChannel:(NSString *)serverId channelId:(NSString *)channelId userId:(NSString *)userId welcome:(nullable NSString *)welcome completion:(void(^)(EMError * _Nullable error))completion NS_SWIFT_NAME(inviteUserToChannel(serverId:channelId:userId:welcome:completion:));
411
421- (void)acceptChannelInvitation:(NSString *)serverId channelId:(NSString *)channelId inviter:(NSString *)inviter completion:(void(^)(EMCircleChannel * _Nullable channel, EMError * _Nullable error))completion;
422
432- (void)declineChannelInvitation:(NSString *)serverId channelId:(NSString *)channelId inviter:(NSString *)inviter completion:(void(^)(EMError * _Nullable error))completion;
433
446- (void)muteUserInChannel:(NSString *)userId serverId:(NSString *)serverId channelId:(NSString *)channelId duration:(NSUInteger)duration completion:(void(^)(EMError * _Nullable error))completion NS_SWIFT_NAME(muteUserInChannel(userId:serverId:channelId:duration:completion:));
447
459- (void)unmuteUserInChannel:(NSString *)userId serverId:(NSString *)serverId channelId:(NSString *)channelId completion:(void(^)(EMError * _Nullable error))completion NS_SWIFT_NAME(unmuteUserInChannel(userId:serverId:channelId:completion:));
460
469- (void)fetchChannelDetail:(NSString *)serverId channelId:(NSString *)channelId completion:(void(^)(EMCircleChannel * _Nullable channel, EMError * _Nullable error))completion;
470
482- (void)fetchPublicChannelsInServer:(NSString *)serverId limit:(NSUInteger)limit cursor:(nullable NSString *)cursor completion:(void(^)(EMCursorResult<EMCircleChannel *> * _Nullable result, EMError * _Nullable error))completion;
483
495- (void)fetchPrivateChannelsInServer:(NSString *)serverId limit:(NSUInteger)limit cursor:(nullable NSString *)cursor completion:(void(^)(EMCursorResult<EMCircleChannel *> * _Nullable result, EMError * _Nullable error))completion;
496
509- (void)fetchPublicChannelsInCategory:(NSString *)serverId categoryId:(NSString *)categoryId limit:(NSUInteger)limit cursor:(nullable NSString *)cursor completion:(void (^)(EMCursorResult<EMCircleChannel *> * _Nullable, EMError * _Nullable))completion;
510
523- (void)fetchPrivateChannelsInCategory:(NSString *)serverId categoryId:(NSString *)categoryId limit:(NSUInteger)limit cursor:(nullable NSString *)cursor completion:(void (^)(EMCursorResult<EMCircleChannel *> * _Nullable, EMError * _Nullable))completion;
524
537- (void)fetchChannelMembers:(NSString *)serverId channelId:(NSString *)channelId limit:(NSUInteger)limit cursor:(nullable NSString *)cursor completion:(void(^)(EMCursorResult<EMCircleUser *> * _Nullable result, EMError * _Nullable error))completion;
538
551- (void)fetchJoinedChannelIdsInServer:(NSString *)serverId limit:(NSUInteger)limit cursor:(nullable NSString *)cursor completion:(void(^)(EMCursorResult<NSString *> * _Nullable result, EMError * _Nullable error))completion;
552
561- (void)checkSelfIsInChannel:(NSString *)serverId channelId:(NSString *)channelId completion:(void(^)(BOOL isJoined, EMError * _Nullable error))completion NS_SWIFT_NAME(checkSelfIsInChannel(serverId:channelId:completion:));
562
571- (void)fetchChannelMuteUsers:(NSString *)serverId channelId:(NSString *)channelId completion:(void(^)(NSDictionary<NSString *, NSNumber *> * _Nullable muteInfo, EMError * _Nullable error))completion;
572
573#pragma mark - category
584- (void)createCategory:(NSString *)serverId name:(NSString *)name completion:(void(^)(EMCircleCategory * _Nullable category, EMError * _Nullable error))completion;
585
598- (void)destroyCategory:(NSString *)serverId categoryId:(NSString *)categoryId completion:(void(^)(EMError * _Nullable error))completion;
599
611- (void)updateCategory:(NSString *)serverId categoryId:(NSString *)categoryId name:(NSString *)name completion:(void(^)(EMCircleCategory * _Nullable category, EMError * _Nullable error))completion;
612
624- (void)transferChannel:(NSString *)serverId channelId:(NSString *)channelId newCategoryId:(nullable NSString *)newCategoryId completion:(void(^)(EMError * _Nullable error))completion;
625
637- (void)fetchCategoriesInServer:(NSString *)serverId limit:(NSUInteger)limit cursor:(nullable NSString *)cursor completion:(void(^)(EMCursorResult<EMCircleCategory *> * _Nullable result, EMError * _Nullable error))completion;
638
639@end
640
641NS_ASSUME_NONNULL_END
Definition: EMCircleCategory.h:14
Definition: EMCircleChannelAttribute.h:17
Definition: EMCircleChannel.h:30
Definition: EMCircleServerAttribute.h:14
Definition: EMCircleServer.h:26
Definition: EMCircleServerTag.h:14
Definition: EMCircleUser.h:20
Definition: EMCursorResult.h:27
Definition: EMError.h:27
Definition: EMCircleManagerCategoryDelegate.h:14
Definition: EMCircleManagerChannelDelegate.h:16
Definition: EMCircleManagerServerDelegate.h:16
Definition: IEMCircleManager.h:36