destroyChatThread method
- required String chatThreadId,
~english Disband Chat Thread.
Group owner and group administrator to which the Chat Thread belongs have permission. After chat thread is disbanded, there will be the following notification:
- Members of the organization (group) to which chat thread belongs will receive the disbanded notification event, and can listen to related events by setting ChatThreadEventHandler. The event callback function is ChatThreadEventHandler.onChatThreadDestroy.
- Multiple devices will receive the notification event and you can set ChatMultiDeviceEventHandler to listen on the event. The event callback function is ChatMultiDeviceEventHandler.onChatThreadEvent, where the first parameter is the event, for example, ChatMultiDevicesEvent.CHAT_THREAD_DESTROY for the chat thread destruction event.
Param chatThreadId
Chat Thread ID.
Throws A description of the exception. See ChatError. ~end
~chinese 解散子区。
@note 只有子区所属群组的群主及管理员可调用该方法。 单设备登录时,子区所在群的所有成员均会收到 ChatThreadEventHandler.onChatThreadDestroy 。 多端多设备登录时,其他设备会收到 ChatMultiDeviceEventHandler.onChatThreadEvent 回调,Event 的值为 ChatMultiDevicesEvent.CHAT_THREAD_DESTROY。
Param chatThreadId
子区 ID。
Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 ChatError。 ~end
Implementation
Future<void> destroyChatThread({
required String chatThreadId,
}) async {
Map req = {
"threadId": chatThreadId,
};
Map result = await _channel.invokeMethod(
ChatMethodKeys.destroyChatThread,
req,
);
try {
ChatError.hasErrorFromResult(result);
} on ChatError catch (e) {
throw e;
}
}