Skip to content

Commit

Permalink
修复挂断音视频通话之后,消息列表的 callStart 消息未实时刷新 fix #440
Browse files Browse the repository at this point in the history
  • Loading branch information
siqiii committed Oct 17, 2024
1 parent dbd4020 commit 7bb5a66
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ let store = {
}
});

wfc.eventEmitter.on(EventType.MessageStatusUpdate, (message) => {
const messageStatusOrContentUpdateListener = (message) => {
console.log('message status update', message)
if (!this._isDisplayMessage(message)) {
return;
Expand All @@ -381,9 +381,12 @@ let store = {

if (conversationState.currentConversationInfo.lastMessage && conversationState.currentConversationInfo.lastMessage.messageId === message.messageId) {
Object.assign(conversationState.currentConversationInfo.lastMessage, message);

}
});
}

wfc.eventEmitter.on(EventType.MessageStatusUpdate, messageStatusOrContentUpdateListener);

wfc.eventEmitter.on(EventType.MessageContentUpdate, messageStatusOrContentUpdateListener);


wfc.eventEmitter.on(EventType.MessageRead, (readEntries) => {
Expand Down
2 changes: 2 additions & 0 deletions src/wfc/client/wfcEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export default class EventType {
static DeleteMessage = 'deleteMsg';
// function (message) {}
static MessageStatusUpdate = 'msgStatusUpdate';
// function (message) {}
static MessageContentUpdate = 'msgContentUpdate';
// function (connectionStatus) {}
static ConnectionStatusChanged = 'connectionStatusChanged';
// function (host/ip/port) {}
Expand Down
4 changes: 3 additions & 1 deletion src/wfc/proto/proto.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ class WfcImpl {
}

getConnectedNetworkType() {
return protoProxy.invoke('getConnectedNetworkType');
return protoProxy.invoke('getConnectedNetworkType');
}

setProtoUserAgent(userAgent) {
Expand Down Expand Up @@ -2533,6 +2533,8 @@ class WfcImpl {
async updateMessageContent(messageId, messageContent) {
let protoMessageContent = messageContent.encode();
protoProxy.invoke('updateMessage', messageId, JSON.stringify(protoMessageContent));
let msg = this.getMessageById(messageId)
this.eventEmitter.emit(EventType.MessageContentUpdate, msg);
}

async updateMessageStatus(messageId, status) {
Expand Down

0 comments on commit 7bb5a66

Please sign in to comment.