Skip to main content
Examples on this page target source snapshot 7e5c198e, not a crates.io release. Use the current API guide to select the matching dependency.

Create once

Build validated CreateCommunityOptions and use result.metadata.id as the created JID. If optional description configuration fails after creation, handle ConfigurationFailed and resume on its created_jid. The community task reference includes a complete recovery example. Creation defaults include a general chat. Change supported options explicitly after construction when your application needs a different policy. Do not recreate an existing parent to repair its description.
Use CreateSubgroupOptions or LinkSubgroupOptions with SubgroupVisibility when visibility matters. Keep successful and failed entries separate when deciding which ones to retry. Query subgroup pagination and membership approval rather than treating a returned container as a complete joined membership list.

Address announcement posts

Use an inbound post’s message_ref() for reactions and comments so its original author and context remain available. A group’s visible addressing namespace is not necessarily the creator identity used for encryption. Store the original creator and secret if you need an encrypted edit or a manually reconstructed reference. client.comments().send_text(&target, text) posts a typed comment. For an already captured parent secret, the comments facade also exposes a typed path using the exact creator and secret; consult its source before bypassing store resolution. A new comment gets its own secret so add-ons can address that comment. For received comments, InboundMessage::comment_target identifies the parent post. InboundMessage::message_ref() still addresses the comment itself.

Read metadata and pictures

Use groups().list_participating or community overviews for listing. Fetch full metadata only when you need it; use group routing information for encryption fanout. These projections have different network, cache and identity-resolution costs. Single community parent pictures use pictures().lookup with ProfilePictureTarget::Community. There is no implicit fallback from the normal group route. See community operations, group projections, pictures and current contracts.