Skip to content

Commit

Permalink
experiment: webxdc.getMemberList api
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-Laux committed Jan 12, 2025
1 parent 293a665 commit 7c21ccd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/target-electron/src/deltachat/webxdc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,18 @@ If you think that's a bug and you need that permission, then please open an issu
this.rpc.leaveWebxdcRealtime(accountId, msgId)
})

ipcMain.handle('webxdc.getMemberList', async event => {
const key = Object.keys(open_apps).find(
key => open_apps[key].win.webContents === event.sender
)
if (!key) {
log.error('webxdc.getMemberList, app not found in list of open ones')
return
}
const { accountId, msgId } = open_apps[key]
return this.rpc.getWebxdcMemberlist(accountId, msgId)
})

ipcMain.handle(
'webxdc.sendToChat',
(
Expand Down
1 change: 1 addition & 0 deletions packages/target-electron/static/webxdc-preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class RealtimeListener {
const api = {
selfAddr: '?Setup Missing?',
selfName: '?Setup Missing?',
getMemberList: () => ipcRenderer.invoke('webxdc.getMemberList'),
setUpdateListener: (cb, start_serial = 0) => {
last_serial = start_serial
callback = cb
Expand Down

0 comments on commit 7c21ccd

Please sign in to comment.