REQ-3284: 推送声音

This commit is contained in:
yanglin 2024-12-03 11:27:16 +08:00
parent 83720d336c
commit f7166d2a87

View File

@ -165,13 +165,11 @@ public class TemplateMessage {
continue;
}
if(pushable && deviceCache.getDevice(receiver.getId()).shouldPush(appType, PushChannel.NIM)) {
if (pushable && !deviceCache.getDevice(receiver.getId()).shouldPush(appType, PushChannel.NIM)) {
ExcludePushPayload excludePush = new ExcludePushPayload();
excludePush.setPersonId(receiver.getId() + "");
excludePush.setAppType(appType);
imReq.getExcludePushPayloads().add(excludePush);
if (StringUtils.isNotBlank(pushData.getVoiceFile()))
ext.put(Intent.INTENT_SOUND, pushData.getVoiceFile());
}
receivers.add(new ReceivePerson(String.valueOf(receiver.getId()), ouId, appType));
@ -189,8 +187,11 @@ public class TemplateMessage {
ext.put("ouId", String.valueOf(sample.getReceiverOuId()));
}
imReq.setExt(ext);
if (pushable)
if (pushable) {
imReq.setPayload(buildPayload(sample, appType));
if (StringUtils.isNotBlank(pushData.getVoiceFile()))
ext.put(Intent.INTENT_SOUND, pushData.getVoiceFile());
}
return imReq;
}