Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
foreign
/
customer-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
13350257
authored
Sep 28, 2021
by
Sixong.Zhu
Committed by
杨铁龙
Sep 29, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
支持消息撤回和撤回消息过滤
parent
19f15b59
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
3 deletions
model/index.ts
store/index.ts
xim/xim.ts
model/index.ts
View file @
13350257
...
...
@@ -52,6 +52,16 @@ export type ChatListRequestList = {
total
:
number
;
};
export
const
enum
MessageType
{
Text
=
"text"
,
Image
=
"image"
,
File
=
"file"
,
Video
=
"video"
,
Voice
=
"voice"
,
GeneralOrderMsg
=
"general_order_msg"
,
Withdraw
=
"withdraw"
,
}
export
interface
Message
{
at_id
:
string
;
chat_id
:
number
;
...
...
@@ -69,7 +79,7 @@ export interface Message {
status
:
number
;
total_read_count
:
number
;
ts
:
number
;
type
:
"text"
|
"image"
|
"file"
|
"video"
|
"voice"
|
"general_order_msg"
;
type
:
MessageType
;
update_time
:
number
;
url
:
string
;
}
...
...
store/index.ts
View file @
13350257
import
{
RootStoreState
}
from
"@/store/model"
;
import
{
Module
}
from
"vuex"
;
import
Vue
from
"vue"
import
{
ChatMember
}
from
"../model"
;
import
{
ChatMember
,
MessageType
}
from
"../model"
;
import
{
isAccessibleUrl
}
from
"../service/tools"
;
import
{
unique
}
from
"../utils"
;
import
{
getChatModelInfo
}
from
"../utils/chat-info"
;
...
...
@@ -787,7 +787,10 @@ export default {
},
getters
:
{
[
ChatStore
.
STATE_CHAT_MSG_HISTORY
](
state
)
{
return
state
[
ChatStore
.
STATE_CHAT_MSG_HISTORY
]
??
[];
// 过滤消息撤回
const
msgList
=
state
[
ChatStore
.
STATE_CHAT_MSG_HISTORY
]
??
[];
const
drawList
=
msgList
.
filter
(
i
=>
i
.
type
===
MessageType
.
Withdraw
).
map
(
i
=>
+
i
.
msg
);
return
msgList
.
filter
(
i
=>
!
drawList
.
includes
(
i
.
id
));
},
[
ChatStore
.
STATE_CHAT_SENDING_MESSAGES
](
state
)
{
return
state
[
ChatStore
.
STATE_CHAT_SENDING_MESSAGES
]
||
[];
...
...
xim/xim.ts
View file @
13350257
...
...
@@ -285,6 +285,16 @@ export class Xim {
return
this
;
}
public
async
withdraw
(
chat
:
number
,
msg
:
number
)
{
this
.
checkConnected
();
if
(
this
.
client
==
null
)
{
throw
new
Error
(
"client shouldn't undefined"
);
}
return
this
.
client
.
withdrawMsg
(
chatType
,
chat
,
msg
)
.
then
((
r
)
=>
r
.
args
[
0
]);
}
/**
* 移除会话(用户端/移动端使用)
*/
...
...
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