Skip to content

api: Unencrypted group creation (#6927) #6932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 13, 2025

Conversation

iequidoo
Copy link
Collaborator

@iequidoo iequidoo commented Jun 22, 2025

Let's discuss the naming here. At the Core level we don't need two separate APIs, so create_group_ex() or smth similar should work. The question is the naming in json-rpc (and CFFI if we decide to add it). Alternatives:

  • create_email_group_chat() or just create_email_chat() (the word "chat" is needed to make it clear that a chat is created, not a message. Actually chat ID is returned). We don't use the word "email" for this purpose in the code currently, but maybe we want to switch to it. I'm not involved in the discussions a lot, so can't say much. But my "external" opinion is that technically everything is email and using this word only for a subset of chats/messages would complicate undestanding the code for newcomers and external audit. But if we switch to "email", probably we need to get rid of "adhoc" in the code.
  • create_adhoc_{group,chat}(). We already have "adhoc" in receive_imf at least.

For now i named it create_group_chat_unencrypted() because i'm used to namespace/prefix naming personally and there are already Chat::is_encrypted() in Core and {FullChat,BasicChat}::is_encrypted in json-rpc which exactly reflect the difference between create_group_chat() and the new function and i decided not to introduce new words.

closes #6927

@link2xt
Copy link
Collaborator

link2xt commented Jun 25, 2025

We also need API to list email contacts. Otherwise there is no way to create anything other than a group with only self.
Maybe even a separate PR because it is useful by itself to modify existing adhoc groups.

@Simon-Laux Simon-Laux removed their request for review June 25, 2025 14:44
Base automatically changed from link2xt/pgp-contacts to main June 26, 2025 14:06
@link2xt link2xt force-pushed the main branch 2 times, most recently from 285d80a to 416131b Compare June 26, 2025 14:07
@iequidoo iequidoo force-pushed the iequidoo/create_group_chat_unencrypted branch from 60a7ba4 to e4b14e2 Compare June 26, 2025 21:31
@iequidoo
Copy link
Collaborator Author

We also need API to list email contacts. Otherwise there is no way to create anything other than a group with only self. Maybe even a separate PR because it is useful by itself to modify existing adhoc groups.

Done in #6958

@r10s r10s mentioned this pull request Jul 12, 2025
5 tasks
@iequidoo iequidoo force-pushed the iequidoo/create_group_chat_unencrypted branch from e4b14e2 to 349770b Compare July 12, 2025 18:33
Copy link
Contributor

@r10s r10s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the code lgtm as far as i can tell.

i tested the implementation already at deltachat/deltachat-ios#2770 - there are some screenshots - works like a charm.

thanks a lot!

@r10s
Copy link
Contributor

r10s commented Jul 13, 2025

for the api wording: from the angle that the core api serve the UI and an is very close to its needs and flows, create_email_chat() seems better

@adbenitez
Copy link
Collaborator

adbenitez commented Jul 13, 2025

personally I like create_group_chat_unencrypted() because as said by @iequidoo it makes it easier to navigate the API since the same as create_group_chat() but with address-contacts, and corresponds better with the chat.is_encrypted() API but would also not die in a naming hill hehe

@iequidoo iequidoo force-pushed the iequidoo/create_group_chat_unencrypted branch from 349770b to 3286cb3 Compare July 13, 2025 14:41
@iequidoo
Copy link
Collaborator Author

for the api wording: from the angle that the core api serve the UI and an is very close to its needs and flows, create_email_chat() seems better

I think that even in UIs the new feature should be named "New {plaintext,unencrypted} email" because it's for users who set up Delta Chat with their existing mailboxes and know that Delta Chat sends emails, so it should be clear how it's different from a "usual" encrypted email.

Let's wait for more opinions a bit and merge this.

@Hocuri
Copy link
Collaborator

Hocuri commented Jul 13, 2025

I also like the API name create_group_chat_unencrypted(), for the reasons already stated. If I saw an API called create_email_chat(), I wouldn't know what it's doing - does it create a 1:1 chat or a group? If I knew DC less well, I might even wonder: Does it create a chat that uses email as the underlying transport?

@iequidoo iequidoo merged commit 752f45f into main Jul 13, 2025
29 checks passed
@iequidoo iequidoo deleted the iequidoo/create_group_chat_unencrypted branch July 13, 2025 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add api dc_create_email() and dc_list_address_contacts()
5 participants