toStorageMap method

Map<String, dynamic> toStorageMap({
  1. required int ownerId,
})

落库用扁平 Map(sequence 以整数写入,保证本地排序/比较与服务端一致)

Implementation

Map<String, dynamic> toStorageMap({required int ownerId}) => {
      'msg_id': msgId,
      'owner_id': ownerId,
      'sequence': seq,
      'msg_type': msgType,
      'from_id': fromId,
      'nickname': nickname,
      'avatar': avatar,
      'is_revoked': isRevoked,
      'send_time': sendTime,
      'extra': encodeJsonString(extra),
      'quote': encodeJsonString(quote),
      'talk_mode': talkMode,
      'to_from_id': toFromId,
      'status': status,
      'conversation_key': '$talkMode-$toFromId',
    };