collectMessage static method

Future<NIMResult<NIMCollectInfo>> collectMessage(
  1. NIMMessage message
)

收藏消息

Implementation

static Future<NIMResult<NIMCollectInfo>> collectMessage(NIMMessage message) {
  var data = message.content;
  if (message.messageAttachment is NIMFileAttachment) {
    data = (message.messageAttachment as NIMFileAttachment).url!;
  }
  var type = message.messageType.getValue();
  return NimCore.instance.messageService
      .addCollect(type: type, data: data!, uniqueId: '${message.serverId}');
}