feat(ui-flow): IPC for DM voice and group member add/remove
Handlers for end-dm-voice, accept-dm-voice, add/remove-group-dm-member.
This commit is contained in:
@@ -1851,6 +1851,19 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
|
|||||||
if (t === 'start-dm-voice') {
|
if (t === 'start-dm-voice') {
|
||||||
const out = await platform.startDmVoiceCall()
|
const out = await platform.startDmVoiceCall()
|
||||||
send({ type: 'dm-voice-call-started', ...out })
|
send({ type: 'dm-voice-call-started', ...out })
|
||||||
|
pushState()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (t === 'end-dm-voice') {
|
||||||
|
const out = await platform.endDmVoiceCall(msg.reason || 'ended')
|
||||||
|
send({ type: 'dm-voice-call-ended', ...out })
|
||||||
|
pushState()
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (t === 'accept-dm-voice') {
|
||||||
|
const out = await platform.acceptDmVoiceCall()
|
||||||
|
send({ type: 'dm-voice-call-accepted', ...out })
|
||||||
|
pushState()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if (t === 'start-dm-video') {
|
if (t === 'start-dm-video') {
|
||||||
@@ -1877,6 +1890,25 @@ async function dispatchUiMessage (platform, msg, hooks = {}) {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if (t === 'add-group-dm-member') {
|
||||||
|
await platform.addGroupDmMember({
|
||||||
|
channelId: msg.channelId,
|
||||||
|
peerUserId: msg.peerUserId
|
||||||
|
})
|
||||||
|
pushState()
|
||||||
|
if (platform.activeChannelId) {
|
||||||
|
send({ type: 'composer-focus-channel', channelId: platform.activeChannelId })
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (t === 'remove-group-dm-member') {
|
||||||
|
await platform.removeGroupDmMember({
|
||||||
|
channelId: msg.channelId,
|
||||||
|
peerUserId: msg.peerUserId
|
||||||
|
})
|
||||||
|
pushState()
|
||||||
|
return true
|
||||||
|
}
|
||||||
if (t === 'typing-start' || t === 'typing') {
|
if (t === 'typing-start' || t === 'typing') {
|
||||||
log.debug('typing.ipc', {
|
log.debug('typing.ipc', {
|
||||||
channelId: platform.activeChannelId,
|
channelId: platform.activeChannelId,
|
||||||
|
|||||||
Reference in New Issue
Block a user