Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
f19303c1
Commit
f19303c1
authored
May 17, 2022
by
罗长华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加禁止发送图片的判断
parent
54743aa0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
7 deletions
+13
-7
config/src/main/resources/static/i18n/messages_zh_CN.properties
+2
-0
core/src/main/java/com/wecloud/im/action/NormalChatAction.java
+7
-3
core/src/main/java/com/wecloud/im/param/ChatContentVo.java
+3
-3
framework/src/main/java/io/geekidea/springbootplus/framework/common/api/ApiCode.java
+1
-1
No files found.
config/src/main/resources/static/i18n/messages_zh_CN.properties
View file @
f19303c1
...
...
@@ -79,3 +79,5 @@ api.response.code.REPETITION_CONVERSATION=已有会话,不能重复创建会话
api.response.code.CLIENT_NOT_FOUNT
=
成员不存在,不能创建会话
api.response.code.IS_BE_BLACK
=
被对方拉黑
api.response.code.IS_TO_BLACK
=
你把对方拉黑
api.response.code.IS_BE_FORBID_SEND_LINK
=
????????
api.response.code.IS_BE_FORBID_SEND_PIC
=
????????
core/src/main/java/com/wecloud/im/action/NormalChatAction.java
View file @
f19303c1
...
...
@@ -144,7 +144,7 @@ public class NormalChatAction {
return
;
}
// 消息内容校验
if
(
checkMsg
(
conversation
,
reqId
,
data
,
request
.
getSenderChannel
()))
{
if
(
!
checkMsg
(
conversation
,
reqId
,
data
,
request
.
getSenderChannel
()))
{
return
;
}
...
...
@@ -415,6 +415,7 @@ public class NormalChatAction {
return
false
;
}
}
if
(
MsgTypeEnum
.
MEDIA_TYPE_TEXT
.
getUriCode
()
==
data
.
getType
())
{
// 判断是否开启禁止发送链接
if
(
conversation
.
getForbidSendLink
())
{
String
regex
=
"((ht|f)tp(s?)\\:\\/\\/)?[0-9a-zA-Z]([-.\\w]*[0-9a-zA-Z])*."
+
...
...
@@ -425,7 +426,6 @@ public class NormalChatAction {
Matcher
mat
=
pat
.
matcher
(
msgContent
.
trim
());
result
=
mat
.
find
();
}
if
(
result
)
{
log
.
info
(
"群: {}, 已被禁止发送链接"
,
conversation
.
getName
());
// 响应发送方
...
...
@@ -436,9 +436,13 @@ public class NormalChatAction {
responseModel
.
setMsg
(
apiResult
.
getMessage
());
responseModel
.
setReqId
(
reqId
);
channelSender
.
sendMsgLocal
((
NioSocketChannel
)
channel
,
responseModel
);
return
false
;
}
return
result
;
}
return
true
;
}
...
...
core/src/main/java/com/wecloud/im/param/ChatContentVo.java
View file @
f19303c1
package
com
.
wecloud
.
im
.
param
;
import
javax.validation.constraints.NotNull
;
import
com.wecloud.dispatch.common.BaseRequest
;
import
com.wecloud.im.ws.model.request.PushVO
;
import
com.wecloud.utils.JsonUtils
;
import
javax.validation.constraints.NotNull
;
/**
* @Description 聊天内容
* @Author lixiaozhong
...
...
@@ -70,7 +70,7 @@ public class ChatContentVo extends BaseRequest {
}
public
String
getText
()
{
return
this
.
get
(
"t
ype
"
)
+
""
;
return
this
.
get
(
"t
ext
"
)
+
""
;
}
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/common/api/ApiCode.java
View file @
f19303c1
...
...
@@ -150,7 +150,7 @@ public enum ApiCode {
/**
* 群已禁止发图片
*/
IS_BE_FORBID_SEND_PIC
(
6018
,
"api.response.code.IS_BE_FORBID_SEND_
LINK
"
),
IS_BE_FORBID_SEND_PIC
(
6018
,
"api.response.code.IS_BE_FORBID_SEND_
PIC
"
),
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment