Skip to content

Commit 7c21ccd

Browse files
committed
experiment: webxdc.getMemberList api
requires core with chatmail/core#6429
1 parent 293a665 commit 7c21ccd

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

packages/target-electron/src/deltachat/webxdc.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,18 @@ If you think that's a bug and you need that permission, then please open an issu
580580
this.rpc.leaveWebxdcRealtime(accountId, msgId)
581581
})
582582

583+
ipcMain.handle('webxdc.getMemberList', async event => {
584+
const key = Object.keys(open_apps).find(
585+
key => open_apps[key].win.webContents === event.sender
586+
)
587+
if (!key) {
588+
log.error('webxdc.getMemberList, app not found in list of open ones')
589+
return
590+
}
591+
const { accountId, msgId } = open_apps[key]
592+
return this.rpc.getWebxdcMemberlist(accountId, msgId)
593+
})
594+
583595
ipcMain.handle(
584596
'webxdc.sendToChat',
585597
(

packages/target-electron/static/webxdc-preload.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ class RealtimeListener {
112112
const api = {
113113
selfAddr: '?Setup Missing?',
114114
selfName: '?Setup Missing?',
115+
getMemberList: () => ipcRenderer.invoke('webxdc.getMemberList'),
115116
setUpdateListener: (cb, start_serial = 0) => {
116117
last_serial = start_serial
117118
callback = cb

0 commit comments

Comments
 (0)