insertAddContactMessage static method

Future<void> insertAddContactMessage(
  1. String userId
)

Implementation

static Future<void> insertAddContactMessage(String userId) async {
  Message alertMsg = Message.createCustomSendMessage(
    targetId: userId,
    event: alertContactAddKey,
    chatType: ChatType.Chat,
    params: {
      alertOperatorIdKey: userId,
    },
  );

  alertMsg.serverTime = DateTime.now().millisecondsSinceEpoch;
  alertMsg.localTime = alertMsg.serverTime;
  alertMsg.status = MessageStatus.SUCCESS;

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