From 20adc6408cd2db0e5b4119647d7cf6c13d5ba9e9 Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Wed, 20 May 2026 22:09:38 +0200 Subject: [PATCH] also include self contact in memberlist, otherwise fetching self avatar does not work. --- deltachat-rpc-server/npm-package/package.json | 38 ++++++++++--------- src/webxdc.rs | 12 +++++- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/deltachat-rpc-server/npm-package/package.json b/deltachat-rpc-server/npm-package/package.json index 4e4640150..b2982312b 100644 --- a/deltachat-rpc-server/npm-package/package.json +++ b/deltachat-rpc-server/npm-package/package.json @@ -1,19 +1,21 @@ { - "license": "MPL-2.0", - "main": "index.js", - "name": "@deltachat/stdio-rpc-server", - "optionalDependencies": {}, - "peerDependencies": { - "@deltachat/jsonrpc-client": "*" - }, - "repository": { - "type": "git", - "url": "https://github.com/chatmail/core.git" - }, - "scripts": { - "prepack": "node scripts/update_optional_dependencies_and_version.js" - }, - "type": "module", - "types": "index.d.ts", - "version": "2.50.0-dev" -} + "license": "MPL-2.0", + "main": "index.js", + "name": "@deltachat/stdio-rpc-server", + "optionalDependencies": { + "@deltachat/stdio-rpc-server-linux-x64": "file:/home/work/Coding/DeltaChat/core/deltachat-rpc-server/npm-package/platform_package/x86_64-unknown-linux-gnu" + }, + "peerDependencies": { + "@deltachat/jsonrpc-client": "file:/home/work/Coding/DeltaChat/core/deltachat-jsonrpc/typescript" + }, + "repository": { + "type": "git", + "url": "https://github.com/chatmail/core.git" + }, + "scripts": { + "prepack": "node scripts/update_optional_dependencies_and_version.js" + }, + "type": "module", + "types": "index.d.ts", + "version": "2.50.0-dev" +} \ No newline at end of file diff --git a/src/webxdc.rs b/src/webxdc.rs index ef94f8903..d738bcf12 100644 --- a/src/webxdc.rs +++ b/src/webxdc.rs @@ -1022,19 +1022,27 @@ impl Message { // We could do the following to increase privacy: // - remove displayname (not that big of a deal in reality) // - only show people in the list that send an status update before in the group (would decrease usefulness, but would still bring enough benefit, if only as internal function to match avatars) - let contacts = chat::get_chat_contacts(context, self.get_chat_id()).await?; + let mut contacts = chat::get_chat_contacts(context, self.get_chat_id()).await?; let mut memberlist = Vec::with_capacity(contacts.len()); + // DM chats don't include self contact + // also webxdc may still need it even when you were removed from a group, + // so we re-add the self contact here. + if !contacts.contains(&ContactId::SELF) { + contacts.push(ContactId::SELF); + } for contact_id in contacts { let contact = contact::Contact::get_by_id(context, contact_id).await?; if let Some(fingerprint) = contact.fingerprint() { memberlist.push((contact, self.get_webxdc_user_id(&fingerprint.hex()))); + } else if contact_id == ContactId::SELF { + memberlist.push((contact, self.get_webxdc_self_addr(context).await?)); } } Ok(memberlist) } /// Returns webxdc memberlist, each member is a tuple (hashed user id/addr, display_name) - /// Only includes members that have a known public key in the database and does not include self contact. + /// Only includes members that have a known public key in the database and it also includes self contact. pub async fn get_webxdc_memberlist(&self, context: &Context) -> Result> { // We could do the following to increase privacy: // - remove displayname (not that big of a deal in reality)