增加群聊置顶、免打扰和应用内提醒

This commit is contained in:
xhgit committed 2026-11-14 16:00:46 +08:00
1 parent ced6e9030d
commit f54077ce46
17 files changed
+228 -42

No files matched your search

+3 -3
View File
@@ -26,7 +26,7 @@ export const useSession = defineStore('session', () => {
const connection = ref('离线')
const contactChanges = ref(0)
const inboxChanges = ref(0)
const groupChange = shallowRef<{ groupId: string }>()
const groupChange = shallowRef<{ groupId: string; notify: boolean }>()
const groupListChanges = ref(0)
let token = ''
let socket: WebSocket | undefined
@@ -54,14 +54,14 @@ export const useSession = defineStore('session', () => {
socket = active
active.onmessage = (event) => {
if (socket !== active) return
const { type, groupId } = JSON.parse(event.data)
const { type, groupId, notify } = JSON.parse(event.data)
if (type === 'ready') {
connection.value = '实时连接已建立'
attempts = 0
}
if (type === 'contacts_changed') contactChanges.value++
if (type === 'inbox_changed') inboxChanges.value++
if (type === 'group_changed' && typeof groupId === 'string') groupChange.value = { groupId }
if (type === 'group_changed' && typeof groupId === 'string') groupChange.value = { groupId, notify: notify === true }
if (type === 'group_list_changed') groupListChanges.value++
}
active.onclose = (event) => {