处理关注与弹幕红包问题
This commit is contained in:
@@ -33,16 +33,21 @@ public class UserChatMsgListener implements ApplicationListener<UserChatMsgEvent
|
||||
IMChatMsgDTO chatMsg = (IMChatMsgDTO) source;
|
||||
String content = chatMsg.getBody();
|
||||
if (StrUtil.isEmpty(content) && StrUtil.isNotEmpty(chatMsg.getAttach())) {
|
||||
if (chatMsg.getAttachObj() == null) {
|
||||
try {
|
||||
chatMsg.setAttachObj(JSONUtil.toBean(chatMsg.getAttach(), IMChatMsgDTO.Attach.class));
|
||||
} catch (Exception ignored) {
|
||||
String attach = chatMsg.getAttach();
|
||||
if (attach.startsWith(StrUtil.DELIM_START) && attach.endsWith(StrUtil.DELIM_END)) {
|
||||
if (chatMsg.getAttachObj() == null) {
|
||||
try {
|
||||
chatMsg.setAttachObj(JSONUtil.toBean(chatMsg.getAttach(), IMChatMsgDTO.Attach.class));
|
||||
} catch (Exception ignored) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
IMChatMsgDTO.Attach attachObj = chatMsg.getAttachObj();
|
||||
if (attachObj != null && StrUtil.isNotEmpty(attachObj.getUrl())) {
|
||||
content = attachObj.getUrl();
|
||||
IMChatMsgDTO.Attach attachObj = chatMsg.getAttachObj();
|
||||
if (attachObj != null && StrUtil.isNotEmpty(attachObj.getUrl())) {
|
||||
content = attachObj.getUrl();
|
||||
}
|
||||
} else {
|
||||
content = attach;
|
||||
}
|
||||
}
|
||||
Long fromUid = null;
|
||||
|
@@ -14,7 +14,11 @@ class FollowRedEnvelopeStrategy : InRoomRedEnvelopeStrategy() {
|
||||
val uid = context.uid
|
||||
val redEnvelope = getRedEnvelope(redEnvelopeId!!)
|
||||
val redEnvelopeUid = redEnvelope.userId
|
||||
return fansService!!.likedExists(uid, redEnvelopeUid)
|
||||
return if (!redEnvelopeUid.equals(uid)) {
|
||||
fansService!!.likedExists(uid, redEnvelopeUid)
|
||||
} else {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
override fun beforeOpen(context: RedEnvelopeContext) {
|
||||
|
Reference in New Issue
Block a user