Skip to content

Commit a0ddd6c

Browse files
committed
update api referance.
1 parent 28c85ce commit a0ddd6c

File tree

10 files changed

+328
-327
lines changed

10 files changed

+328
-327
lines changed

lib/src/em_chat_manager.dart

Lines changed: 46 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class EMChatManager {
181181
}
182182

183183
/// ~english
184-
/// Resend a message.
184+
/// Resends a message.
185185
///
186186
/// Param [message] The message object to be resent: [EMMessage].
187187
/// ~end
@@ -478,7 +478,7 @@ class EMChatManager {
478478
/// ~end
479479
///
480480
/// ~chinese
481-
/// 根据threadId 获取 thread 会话。
481+
/// 根据thread ID 获取 thread 会话。
482482
///
483483
/// Param [threadId] Thread ID.
484484
///
@@ -746,7 +746,7 @@ class EMChatManager {
746746
@Deprecated('Use [fetchConversation] instead')
747747

748748
/// ~english
749-
/// fetch the conversations from the server.
749+
/// Gets the list of conversations from the server.
750750
///
751751
/// Param [pageNum] The current page number.
752752
///
@@ -758,11 +758,11 @@ class EMChatManager {
758758
/// ~end
759759
///
760760
/// ~chinese
761-
/// 获取服务器会话
761+
/// 获取服务器会话列表
762762
///
763-
/// Param [pageNum] 获取的页码
763+
/// Param [pageNum] 当前页码
764764
///
765-
/// Param [pageSize] 获取页中返回数量
765+
/// Param [pageSize] 每页期望返回的会话数量
766766
///
767767
/// **Return** 当前用户的会话列表。
768768
///
@@ -799,7 +799,7 @@ class EMChatManager {
799799
/// The SDK retrieves the list of conversations in the reverse chronological order of their active time (the timestamp of the last message).
800800
/// If there is no message in the conversation, the SDK retrieves the list of conversations in the reverse chronological order of their creation time.
801801
///
802-
/// Param [cursor] The position from which to start getting data. the SDK retrieves conversations from the latest active one if no set.
802+
/// Param [cursor] The position from which to start getting data. The SDK retrieves conversations from the latest active one if this parameter is not set.
803803
///
804804
/// Param [pageSize] The number of conversations that you expect to get on each page. The value range is [1,50].
805805
///
@@ -809,7 +809,7 @@ class EMChatManager {
809809
/// ~end
810810
///
811811
/// ~chinese
812-
/// 分页从服务器获取获取会话列表
812+
/// 从服务器分页获取会话列表
813813
///
814814
/// SDK 按照会话活跃时间(会话的最后一条消息的时间戳)倒序返回会话列表。
815815
/// 若会话中没有消息,则 SDK 按照会话创建时间的倒序返回会话列表。
@@ -978,11 +978,11 @@ class EMChatManager {
978978
///
979979
/// Param [pageSize] The number of messages per page.
980980
///
981-
/// Param [direction] The direction of the search to be fetched. See [EMSearchDirection].
981+
/// Param [direction] The message search direction. See [EMSearchDirection].
982982
///
983-
/// Param [startMsgId] The ID of the message from which you start to get the historical messages. If `null` is passed, the SDK gets messages in reverse chronological order.
983+
/// Param [startMsgId] The ID of the message from which you start to get the historical messages. If `null` is passed, the SDK gets messages in the reverse chronological order.
984984
///
985-
/// **Return** The obtained messages and the cursor for the next fetch action.
985+
/// **Return** The obtained messages and the cursor for the next query.
986986
///
987987
/// **Throws** A description of the exception. See [EMError].
988988
/// ~end
@@ -1032,7 +1032,7 @@ class EMChatManager {
10321032
}
10331033

10341034
/// ~english
1035-
/// [FetchMessageOptions] paging from the server to retrieve the history message for the specified session.
1035+
/// Gets historical messages of a conversation from the server according to [FetchMessageOptions].
10361036
///
10371037
/// Param [conversationId] The conversation ID, which is the user ID of the peer user for one-to-one chat, but the group ID for group chat.
10381038
///
@@ -1097,7 +1097,7 @@ class EMChatManager {
10971097
///
10981098
/// Param [maxCount] The maximum number of messages to retrieve each time.
10991099
///
1100-
/// Param [from] A username or group ID at which the retrieval is targeted. Usually, it is the conversation ID.
1100+
/// Param [from] A user ID or group ID at which the retrieval is targeted. Usually, it is the conversation ID.
11011101
///
11021102
/// **Return** The list of messages.
11031103
///
@@ -1152,7 +1152,6 @@ class EMChatManager {
11521152
/// ~english
11531153
/// Gets read receipts for group messages from the server with pagination.
11541154
///
1155-
/// See also:
11561155
/// For how to send read receipts for group messages, see [sendConversationReadAck].
11571156
///
11581157
/// Param [msgId] The message ID.
@@ -1219,7 +1218,7 @@ class EMChatManager {
12191218
///
12201219
/// Param [conversationType] The conversation type. See [EMConversationType].
12211220
///
1222-
/// Param [isDeleteRemoteMessage] Whether to delete the server chat history when deleting the conversation.
1221+
/// Param [isDeleteMessage] Whether to delete the chat history when deleting the conversation.
12231222
/// - `true`: (default) Yes.
12241223
/// - `false`: No.
12251224
///
@@ -1234,7 +1233,7 @@ class EMChatManager {
12341233
///
12351234
/// Param [conversationType] 会话类型,详见 [EMConversationType]
12361235
///
1237-
/// Param [isDeleteRemoteMessage] 删除会话时是否同时删除服务器历史消息记录
1236+
/// Param [isDeleteMessage] 删除会话时是否同时删除历史消息记录
12381237
///
12391238
/// - (默认)`true`:是;
12401239
/// - `false`:否。
@@ -1244,7 +1243,7 @@ class EMChatManager {
12441243
Future<void> deleteRemoteConversation(
12451244
String conversationId, {
12461245
EMConversationType conversationType = EMConversationType.Chat,
1247-
bool isDeleteRemoteMessage = true,
1246+
bool isDeleteMessage = true,
12481247
}) async {
12491248
Map req = {};
12501249
req["conversationId"] = conversationId;
@@ -1255,7 +1254,7 @@ class EMChatManager {
12551254
} else {
12561255
req["conversationType"] = 2;
12571256
}
1258-
req["isDeleteRemoteMessage"] = isDeleteRemoteMessage;
1257+
req["isDeleteRemoteMessage"] = isDeleteMessage;
12591258

12601259
Map data = await ChatChannel.invokeMethod(
12611260
ChatMethodKeys.deleteRemoteConversation, req);
@@ -1330,11 +1329,11 @@ class EMChatManager {
13301329
}
13311330

13321331
/// ~english
1333-
/// Adds a reaction.
1332+
/// Adds a Reaction.
13341333
///
13351334
/// Param [messageId] The message ID.
13361335
///
1337-
/// Param [reaction] The reaction content.
1336+
/// Param [reaction] The Reaction content.
13381337
///
13391338
/// **Throws** A description of the exception. See [EMError].
13401339
/// ~end
@@ -1363,11 +1362,11 @@ class EMChatManager {
13631362
}
13641363

13651364
/// ~english
1366-
/// Deletes a reaction.
1365+
/// Deletes a Reaction.
13671366
///
13681367
/// Param [messageId] The message ID.
13691368
///
1370-
/// Param [reaction] The reaction content.
1369+
/// Param [reaction] The Reaction content.
13711370
///
13721371
/// **Throws** A description of the exception. See [EMError].
13731372
/// ~end
@@ -1402,7 +1401,7 @@ class EMChatManager {
14021401
///
14031402
/// Param [chatType] The chat type. Only one-to-one chat [ChatType.Chat] and group chat [ChatType.GroupChat] are allowed.
14041403
///
1405-
/// Param [groupId] which is valid only when the chat type is group chat.
1404+
/// Param [groupId] The group ID. This parameter is valid only when the chat type is group chat.
14061405
///
14071406
/// **Return** The Reaction list under the specified message ID([EMMessageReaction.userList] is the summary data, which only contains the information of the first three users).
14081407
///
@@ -1454,11 +1453,11 @@ class EMChatManager {
14541453
}
14551454

14561455
/// ~english
1457-
/// Gets the reaction details.
1456+
/// Gets the Reaction details.
14581457
///
14591458
/// Param [messageId] The message ID.
14601459
///
1461-
/// Param [reaction] The reaction content.
1460+
/// Param [reaction] The Reaction content.
14621461
///
14631462
/// Param [cursor] The cursor position from which to get Reactions.
14641463
///
@@ -1512,13 +1511,13 @@ class EMChatManager {
15121511
}
15131512

15141513
/// ~english
1515-
/// Translate a message.
1514+
/// Translates a text message.
15161515
///
1517-
/// Param [msg] The message object
1516+
/// Param [msg] The message object for translation.
15181517
///
1519-
/// Param [languages] The target languages to translate
1518+
/// Param [languages] The list of target language codes.
15201519
///
1521-
/// **Return** Translated Message
1520+
/// **Return** The translated message.
15221521
///
15231522
/// **Throws** A description of the exception. See [EMError].
15241523
/// ~end
@@ -1528,7 +1527,7 @@ class EMChatManager {
15281527
///
15291528
/// Param [msg] 要翻译的文本消息。
15301529
///
1531-
/// Param [languages] 目标语言
1530+
/// Param [languages] 目标语言代码列表
15321531
///
15331532
/// **Return** 译文。
15341533
///
@@ -1552,9 +1551,9 @@ class EMChatManager {
15521551
}
15531552

15541553
/// ~english
1555-
/// Fetch all languages what the translate service support
1554+
/// Gets all languages supported by the translation service.
15561555
///
1557-
/// **Return** Supported languages
1556+
/// **Return** The supported languages.
15581557
///
15591558
/// **Throws** A description of the exception. See [EMError].
15601559
/// ~end
@@ -1586,7 +1585,7 @@ class EMChatManager {
15861585
///
15871586
/// The SDK returns the pinned conversations in the reverse chronological order of their pinning.
15881587
///
1589-
/// Param [cursor] The position from which to start getting data. the SDK retrieves conversations from the latest pinned one if no set.
1588+
/// Param [cursor] The position from which to start getting data. If this parameter is not set, the SDK retrieves conversations from the latest pinned one.
15901589
///
15911590
/// Param [pageSize] The number of conversations that you expect to get on each page. The value range is [1,50].
15921591
///
@@ -1674,9 +1673,11 @@ class EMChatManager {
16741673
}
16751674

16761675
/// ~english
1677-
/// Modifies a local message or a message at the server side.
1676+
/// Modifies a message.
16781677
///
1679-
/// You can call this method to only modify a text message in one-to-one chats or group chats, but not in chat rooms.
1678+
/// After this method is called to modify a message, both the local message and the message on the server are modified.
1679+
///
1680+
/// This method can only modify a text message in one-to-one chats or group chats, but not in chat rooms.
16801681
///
16811682
/// Param [messageId] The ID of the message to modify.
16821683
///
@@ -1688,12 +1689,14 @@ class EMChatManager {
16881689
/// ~end
16891690
///
16901691
/// ~chinese
1691-
/// 修改本地以及服务端的消息内容
1692+
/// 修改消息内容
16921693
///
1693-
/// 只能调用该方法修改单聊和群聊中的文本消息,不能修改聊天室消息
1694+
/// 调用该方法修改消息内容后,本地和服务端的消息均会修改
16941695
///
1695-
/// Param [messageId] 消息实例id
1696+
/// 只能调用该方法修改单聊和群聊中的文本消息,不能修改聊天室消息
16961697
///
1698+
/// Param [messageId] 消息实例 ID。
1699+
///
16971700
/// Param [msgBody] 文本消息体实例 [EMTextMessageBody]
16981701
///
16991702
/// **Return** 修改后的消息实例。
@@ -1722,21 +1725,21 @@ class EMChatManager {
17221725
}
17231726

17241727
/// ~english
1725-
/// fetch combine message detail.
1728+
/// Gets the details of a combined message.
17261729
///
1727-
/// Param [message] The combine message.
1730+
/// Param [message] The combined message.
17281731
///
1729-
/// **Return** The combined message list.
1732+
/// **Return** The list of original messages included in the combined message.
17301733
///
17311734
/// **Throws** A description of the exception. See [EMError].
17321735
/// ~end
17331736
///
17341737
/// ~chinese
1735-
/// 获取合并消息详情
1738+
/// 获取合并消息的详情
17361739
///
17371740
/// Param [message] 合并消息。
17381741
///
1739-
/// **Return** 合并后的消息列表
1742+
/// **Return** 合并消息包含的原始消息列表
17401743
///
17411744
/// **Throws** 如果有异常会在这里抛出,包含错误码和错误描述,详见 [EMError]
17421745
/// ~end

0 commit comments

Comments
 (0)