NIMSDK-iOS
载入中...
搜索中...
未找到
NIMQChatMessageExtendManagerProtocol.h
浏览该文件的文档.
1//
2// NIMQChatMessageExtendManagerProtocol.h
3// NIMLib
4//
5// Created by Netease.
6// Copyright © 2022 Netease. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
11#import "NIMQChatMessage.h"
12
15
21
22NS_ASSUME_NONNULL_BEGIN
23
24/**
25 * 拉取thread消息的回调
26 *
27 * @param error 错误信息
28 * @param result 回调结果
29 */
30typedef void(^NIMQChatGetThreadMessagesHandler)(NSError *__nullable error, NIMQChatGetThreadMessagesResult *__nullable result);
31
32/**
33 * 拉取消息Thread信息的回调
34 *
35 * @param error 错误信息
36 * @param result 回调结果 [消息的messageId: NIMQChatMessageThreadInfo]
37 */
38typedef void(^NIMQChatBatchGetMessageThreadInfoHandler)(NSError *__nullable error, NSDictionary <NSString *, NIMQChatMessageThreadInfo *> *__nullable result);
39
40/**
41 * 圈组消息扩展管理器回调
42 */
43@protocol NIMQChatMessageExtendManagerDelegate <NSObject>
44
45@optional
46
47@end
48
49
50/**
51 * 批量获取快捷评论回调
52 *
53 * @param error 结果
54 * @param result 获取结果
55 */
56typedef void (^NIMQChatFetchQuickCommentsByMsgsHandler) (NSError * _Nullable error, NIMQChatFetchQuickCommentsByMsgsResult * _Nullable result);
57
58/**
59 * 批量获取快捷评论的评论者信息回调
60 *
61 * @param error 结果
62 * @param result 获取结果
63 */
64typedef void (^NIMQChatGetCommentatorsHandler) (NSError * _Nullable error, NIMQChatGetCommentatorsResult * _Nullable result);
65
66/**
67 * 圈组消息扩展管理器
68 */
69@protocol NIMQChatMessageExtendManager <NSObject>
70
71#pragma mark - Thread Message
72
73/**
74 * 回复消息
75 *
76 * @param message 新生成的消息
77 * @param target 被回复的消息
78 * @param error 错误 如果在准备发送消息阶段发生错误,这个error会被填充相应的信息
79 *
80 * @return 是否调用成功,这里返回的 result 只是表示当前这个函数调用是否成功,需要后续的回调才能够判断消息是否已经发送至服务器
81 */
82- (BOOL)reply:(NIMQChatMessage *)message
83 to:(NIMQChatMessage *)target
84 error:(NSError * __nullable *)error;
85
86/**
87 * 异步回复消息
88 *
89 * @param message 新生成的消息
90 * @param target 被回复的消息
91 * @param completion 发送完成后的回调,这里的回调完成只表示当前这个函数调用完成,需要后续的回调才能判断消息是否已经发送至服务器
92 */
93- (void)reply:(NIMQChatMessage *)message
94 to:(NIMQChatMessage *)target
95 completion:(__nullable NIMQChatHandler)completion;
96
97/**
98 * 从服务端查询引用的消息
99 *
100 * @param message 消息
101 * @param type 引用类型
102 * @param completion 结果回调
103 */
104- (void)getReferMessages:(NIMQChatMessage *)message
105 type:(NIMQChatMessageReferType)type
106 completion:(nullable NIMQChatGetMessageHistoryHandler)completion;
107
108/**
109 * 从服务端查询Thread的所有消息
110 *
111 * @param param 传入参数
112 * @param completion 结果回调
113 */
114- (void)getThreadMessages:(NIMQChatGetThreadMessagesParam *)param
115 completion:(nullable NIMQChatGetThreadMessagesHandler)completion;
116
117/**
118 * 批量从服务端查询消息Thread的meta信息
119 *
120 * @param param 传入参数,消息数组
121 * @param completion 结果回调
122 */
123- (void)batchGetMessageThreadInfo:(NSArray <NIMQChatMessage *> *)param
124 completion:(nullable NIMQChatBatchGetMessageThreadInfoHandler)completion;
125
126
127#pragma mark - Quick Comment
128/**
129 * 发送快捷评论
130 *
131 * @param type 评论类型
132 * @param message 被评论消息
133 * @param completion 完成回调
134 */
135- (void)addQuickCommentType:(int64_t)type
136 toMessage:(NIMQChatMessage *)message
137 completion:(NIMQChatHandler _Nullable)completion;
138
139/**
140 * 从服务端删除一条评论
141 *
142 * @param type 评论类型
143 * @param message 被评论消息
144 * @param completion 完成回调
145 */
146- (void)deleteQuickCommentType:(int64_t)type
147 toMessage:(NIMQChatMessage *)message
148 completion:(NIMQChatHandler _Nullable)completion;
149
150/**
151 * 批量获取快捷评论
152 *
153 * @param messages 参数,消息列表,必须为同一个频道内的消息
154 * @param completion 完成回调
155 */
156- (void)fetchQuickComments:(NSArray <NIMQChatMessage *> *)messages
157 completion:(NIMQChatFetchQuickCommentsByMsgsHandler)completion;
158
159/**
160 * 获取评论者列表
161 *
162 * @param message
163 * @param completion
164 */
165- (void)getCommentators:(NIMQChatGetCommentatorsParam *)param
166 completion:(NIMQChatGetCommentatorsHandler _Nullable)completion;
167
168/**
169 * 添加通知对象
170 *
171 * @param delegate 通知对象
172 */
173- (void)addDelegate:(id<NIMQChatMessageExtendManagerDelegate>)delegate;
174
175/**
176 * 移除通知对象
177 *
178 * @param delegate 通知对象
179 */
180- (void)removeDelegate:(id<NIMQChatMessageExtendManagerDelegate>)delegate;
181
182@end
183
184NS_ASSUME_NONNULL_END
void(^ NIMQChatHandler)(NSError *__nullable error)
Definition: NIMQChatDefs.h:276
NIMQChatMessageReferType
Definition: NIMQChatMessage.h:52
void(^ NIMQChatBatchGetMessageThreadInfoHandler)(NSError *__nullable error, NSDictionary< NSString *, NIMQChatMessageThreadInfo * > *__nullable result)
Definition: NIMQChatMessageExtendManagerProtocol.h:38
void(^ NIMQChatGetCommentatorsHandler)(NSError *_Nullable error, NIMQChatGetCommentatorsResult *_Nullable result)
Definition: NIMQChatMessageExtendManagerProtocol.h:64
void(^ NIMQChatFetchQuickCommentsByMsgsHandler)(NSError *_Nullable error, NIMQChatFetchQuickCommentsByMsgsResult *_Nullable result)
Definition: NIMQChatMessageExtendManagerProtocol.h:56
NS_ASSUME_NONNULL_BEGIN typedef void(^ NIMQChatGetThreadMessagesHandler)(NSError *__nullable error, NIMQChatGetThreadMessagesResult *__nullable result)
void(^ NIMQChatGetMessageHistoryHandler)(NSError *__nullable error, NIMQChatGetMessageHistoryResult *__nullable result)
Definition: NIMQChatMessageManagerProtocol.h:67
Definition: NIMQChatFetchQuickCommentsByMsgsResult.h:18
Definition: NIMQChatGetCommentatorsParam.h:9
Definition: NIMQChatGetCommentatorsResult.h:10
Definition: NIMQChatGetThreadMessagesParam.h:19
Definition: NIMQChatGetThreadMessagesResult.h:19
Definition: NIMQChatMessage.h:76
Definition: NIMQChatMessageThreadInfo.h:16
Definition: NIMQChatUpdateQuickCommentInfo.h:16