Skip to content

去log + 收到消息更新状态 #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev_3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion demo/src/components/chat/ChatMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,15 @@ export default ({ bySelf, from, time, body, status, id, toJid, to, ok, type, ...
const localFormat = renderTime(time)

let content = null

function oncontextmenu(toJid){
if(!toJid){
return message.error('撤回失败')
}
WebIM.conn.recallMessage({
to: to,
mid: toJid,
group: type,
type: type,
success: function(){
ok(id)
},
Expand Down
1 change: 0 additions & 1 deletion demo/src/redux/MessageRedux.js
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,6 @@ export const updateMessageStatus = (state, { message, status = "" }) => {
let mids = state.getIn([ "byMid" ])||{}
let mid
for( var i in mids){
console.log('ii',i)
if(mids[i].id == id){
mid = i
}
Expand Down
2 changes: 1 addition & 1 deletion demo/src/redux/WebIMRedux.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ WebIM.conn.listen({
logger.info("onReceivedMessage", message)
const { id, mid } = message
store.dispatch(MessageActions.updateMessageMid(id, mid))
store.dispatch(MessageActions.updateMessageStatus(message, "sent"))
},
onRecallMessage: message => {
console.log("撤回消息", message)
store.dispatch(MessageActions.deleteMessage(message))
logger.info("onRecallMessage", message)
},
Expand Down
3 changes: 1 addition & 2 deletions demo/src/utils/AppDB.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ const AppDB = {
},

deleteMessage(id){
console.log('ddddd', id)
const $_TABLE = this.$_TABLE
return this.exec(resolve => {
$_TABLE.where("id")
Expand All @@ -120,7 +119,7 @@ const AppDB = {
$_TABLE.where("id")
.equals(id)
.modify({ "toJid": mid })
.then(res => console.log('res',res))
.then(res => {})
})
}, 1000)

Expand Down