多选送礼消息增加targetUids数据(兼容旧版PK模式和iOS)

This commit is contained in:
huangjian
2020-12-23 16:32:53 +08:00
parent 3b174d9d2e
commit 7dc8f09d61

View File

@@ -226,10 +226,13 @@ public class GiftToolbox {
CustomAttachment.CUSTOM_MSG_SUB_TYPE_BATCH_SEND_GIFT);
//这里去掉收礼物人的头像字段,减少容量
GiftMultiReceiverInfo tmpData = new Gson().fromJson(new Gson().toJson(data), GiftMultiReceiverInfo.class);
List<Long> targetUids = new ArrayList<>();
for (GiftReceiver targetUser : tmpData.getTargetUsers()) {
targetUser.setAvatar(null);
targetUids.add(targetUser.getUid());
}
//兼容旧版PK模式和iOS
tmpData.setTargetUids(targetUids);
giftBatchAttachment.setGiftMultiReceiverInfo(tmpData);
int giftId = tmpData.getGiftId();
GiftInfo giftInfo = GiftModel.get().findGiftInfoById(giftId);