updateChatThreadName method

Future<void> updateChatThreadName({
  1. required String chatThreadId,
  2. required String newName,
})

~english Change Chat Thread name.

The group owner, group administrator and Thread creator have permission. After modifying chat thread name, members of the organization (group) to which chat thread belongs will receive the update notification event. You can set ChatThreadEventHandler.onChatThreadUpdate to listen on the event.

Param chatThreadId Chat Thread ID.

Param newName New Chat Thread name. No more than 64 characters in length.

Throws A description of the exception. See ChatError. ~end

~chinese 修改子区名称。

@note 只有子区所属群主、群管理员及子区创建者可调用该方法。

子区所属群组的所有成员均会收到 ChatThreadEventHandler.onChatThreadUpdate

Param chatThreadId 子区 ID。

Param newName 子区的新名称。长度不超过 64 个字符。

Throws 如果有异常会在此抛出,包括错误码和错误信息,详见 ChatError。 ~end

Implementation

Future<void> updateChatThreadName({
  required String chatThreadId,
  required String newName,
}) async {
  Map req = {
    "name": newName,
    "threadId": chatThreadId,
  };
  Map result = await _channel.invokeMethod(
    ChatMethodKeys.updateChatThreadSubject,
    req,
  );
  try {
    ChatError.hasErrorFromResult(result);
  } on ChatError catch (e) {
    throw e;
  }
}