insertGroupDestroyMessage static method

Future<void> insertGroupDestroyMessage(
  1. String groupId
)

Implementation

static Future<void> insertGroupDestroyMessage(String groupId) async {
  if (Client.getInstance.options?.deleteMessagesAsExitGroup == true) {
    return;
  }
  Message alertMsg = Message.createCustomSendMessage(
    targetId: groupId,
    event: alertGroupDestroyKey,
    chatType: ChatType.GroupChat,
  );
  alertMsg.conversationId = groupId;
  alertMsg.serverTime = DateTime.now().millisecondsSinceEpoch;
  alertMsg.localTime = alertMsg.serverTime;
  alertMsg.status = MessageStatus.SUCCESS;

  await ChatSDKService.instance.insertMessage(
    message: alertMsg,
    runMessageReceived: true,
    needUpdateConversationList: true,
  );
}