|
@@ -109,6 +109,9 @@ const MessageMemberCount = RongIMLib.registerMessageType('RC:Chatroom:MemberCoun
|
|
|
// 当前连麦人员同步
|
|
|
const MessageSeatMember = RongIMLib.registerMessageType('RC:Chatroom:SeatMember', true, true)
|
|
|
|
|
|
+// 当前点赞数量同步
|
|
|
+const MessageLikeCount = RongIMLib.registerMessageType('RC:Chatroom:LikeCount', true, true)
|
|
|
+
|
|
|
|
|
|
type MessageProps = {
|
|
|
messageType: 'RC:Chatroom:Welcome' | 'RC:TxtMsg' | 'RC:Chatroom:Barrage' | 'RC:Chatroom:Like' | 'RC:Chatroom:SeatsCtrl' | 'RC:Chatroom:ChatBan' | 'RC:Chatroom:SeatApply',
|
|
@@ -522,6 +525,7 @@ export const loopSyncLike = async () => {
|
|
|
}
|
|
|
})
|
|
|
runtime.lastLikeCount = runtime.likeCount
|
|
|
+ sendMessage({ count: runtime.likeCount }, 'LikeCount')
|
|
|
} catch (error) {}
|
|
|
}
|
|
|
setTimeout(() => {
|
|
@@ -529,7 +533,7 @@ export const loopSyncLike = async () => {
|
|
|
}, 1000 * 30)
|
|
|
}
|
|
|
|
|
|
-type SendMessageType = 'text' | 'image' | 'audio' | 'video' | 'file' | 'SeatsCtrl' | 'ChatBan' | 'SeatApply' | 'SeatResponse' | 'MemberCount' | 'SeatMember'
|
|
|
+type SendMessageType = 'text' | 'image' | 'audio' | 'video' | 'file' | 'SeatsCtrl' | 'ChatBan' | 'SeatApply' | 'SeatResponse' | 'MemberCount' | 'SeatMember' | 'LikeCount'
|
|
|
|
|
|
export const getSendMessageUser = () => {
|
|
|
return {
|
|
@@ -570,6 +574,8 @@ export const sendMessage = async (msg: any, type: SendMessageType = 'text') => {
|
|
|
message = new MessageMemberCount(msg)
|
|
|
} else if(type === 'SeatMember') {
|
|
|
message = new MessageSeatMember(msg)
|
|
|
+ } else if(type === 'LikeCount') {
|
|
|
+ message = new MessageLikeCount(msg)
|
|
|
}
|
|
|
if (!message) return
|
|
|
console.log(message)
|