pub struct Conversation { /* private fields */ }Expand description
A conversation handle (DM or group).
Implementations§
Source§impl Conversation
impl Conversation
Sourcepub fn conversation_type(&self) -> Option<ConversationType>
pub fn conversation_type(&self) -> Option<ConversationType>
Conversation type (DM, Group, etc.).
Sourcepub fn created_at_ns(&self) -> i64
pub fn created_at_ns(&self) -> i64
Created-at timestamp in nanoseconds.
Sourcepub fn membership_state(&self) -> Option<MembershipState>
pub fn membership_state(&self) -> Option<MembershipState>
Current membership state of this client in the conversation.
Sourcepub fn dm_peer_inbox_id(&self) -> Option<String>
pub fn dm_peer_inbox_id(&self) -> Option<String>
DM peer’s inbox ID. Returns None if not a DM.
Sourcepub fn added_by_inbox_id(&self) -> Option<String>
pub fn added_by_inbox_id(&self) -> Option<String>
Inbox ID of the member who added this client.
Sourcepub fn description(&self) -> Option<String>
pub fn description(&self) -> Option<String>
Get the group description.
Sourcepub fn set_description(&self, value: &str) -> Result<()>
pub fn set_description(&self, value: &str) -> Result<()>
Set the group description.
Sourcepub fn set_image_url(&self, value: &str) -> Result<()>
pub fn set_image_url(&self, value: &str) -> Result<()>
Set the group image URL.
Sourcepub fn set_app_data(&self, value: &str) -> Result<()>
pub fn set_app_data(&self, value: &str) -> Result<()>
Set app data (max 8192 bytes).
Sourcepub fn paused_for_version(&self) -> Result<Option<String>>
pub fn paused_for_version(&self) -> Result<Option<String>>
Check if conversation is paused for a version upgrade.
Sourcepub fn metadata(&self) -> Result<ConversationMetadata>
pub fn metadata(&self) -> Result<ConversationMetadata>
Get the conversation metadata (creator inbox ID + type).
Sourcepub fn permissions(&self) -> Result<Permissions>
pub fn permissions(&self) -> Result<Permissions>
Get the group permissions (preset + full policy set).
Sourcepub fn send(&self, content: &[u8]) -> Result<String>
pub fn send(&self, content: &[u8]) -> Result<String>
Send raw encoded content bytes. Returns the hex-encoded message ID.
Sourcepub fn send_with(&self, content: &[u8], opts: &SendOptions) -> Result<String>
pub fn send_with(&self, content: &[u8], opts: &SendOptions) -> Result<String>
Send with options. Returns the hex-encoded message ID.
Sourcepub fn send_optimistic(&self, content: &[u8]) -> Result<String>
pub fn send_optimistic(&self, content: &[u8]) -> Result<String>
Send optimistically (returns immediately, publishes in background).
Sourcepub fn send_optimistic_with(
&self,
content: &[u8],
opts: &SendOptions,
) -> Result<String>
pub fn send_optimistic_with( &self, content: &[u8], opts: &SendOptions, ) -> Result<String>
Send optimistically with options.
Sourcepub fn publish_messages(&self) -> Result<()>
pub fn publish_messages(&self) -> Result<()>
Publish all queued (unpublished) messages.
Sourcepub fn list_messages(
&self,
options: &ListMessagesOptions,
) -> Result<Vec<Message>>
pub fn list_messages( &self, options: &ListMessagesOptions, ) -> Result<Vec<Message>>
List messages with filtering options.
Sourcepub fn count_messages(&self, options: &ListMessagesOptions) -> i64
pub fn count_messages(&self, options: &ListMessagesOptions) -> i64
Count messages matching filter options.
Sourcepub fn members(&self) -> Result<Vec<GroupMember>>
pub fn members(&self) -> Result<Vec<GroupMember>>
List members of this conversation.
Sourcepub fn add_members_by_inbox_id(&self, inbox_ids: &[&str]) -> Result<()>
pub fn add_members_by_inbox_id(&self, inbox_ids: &[&str]) -> Result<()>
Add members by inbox IDs.
Sourcepub fn remove_members_by_inbox_id(&self, inbox_ids: &[&str]) -> Result<()>
pub fn remove_members_by_inbox_id(&self, inbox_ids: &[&str]) -> Result<()>
Remove members by inbox IDs.
Sourcepub fn add_members_by_identity(
&self,
identifiers: &[AccountIdentifier],
) -> Result<()>
pub fn add_members_by_identity( &self, identifiers: &[AccountIdentifier], ) -> Result<()>
Add members by external identifiers (address + kind).
Sourcepub fn remove_members_by_identity(
&self,
identifiers: &[AccountIdentifier],
) -> Result<()>
pub fn remove_members_by_identity( &self, identifiers: &[AccountIdentifier], ) -> Result<()>
Remove members by external identifiers (address + kind).
Sourcepub fn consent_state(&self) -> Result<ConsentState>
pub fn consent_state(&self) -> Result<ConsentState>
Get the consent state for this conversation.
Sourcepub fn set_consent(&self, state: ConsentState) -> Result<()>
pub fn set_consent(&self, state: ConsentState) -> Result<()>
Set the consent state for this conversation.
Sourcepub fn disappearing_settings(&self) -> Option<DisappearingSettings>
pub fn disappearing_settings(&self) -> Option<DisappearingSettings>
Get the current disappearing message settings.
Sourcepub fn set_disappearing(&self, settings: DisappearingSettings) -> Result<()>
pub fn set_disappearing(&self, settings: DisappearingSettings) -> Result<()>
Set disappearing message settings.
Sourcepub fn clear_disappearing(&self) -> Result<()>
pub fn clear_disappearing(&self) -> Result<()>
Clear disappearing message settings.
Sourcepub fn is_disappearing_enabled(&self) -> bool
pub fn is_disappearing_enabled(&self) -> bool
Whether disappearing messages are enabled.
Sourcepub fn set_permission_policy(
&self,
update_type: PermissionUpdateType,
policy: PermissionPolicy,
metadata_field: Option<MetadataField>,
) -> Result<()>
pub fn set_permission_policy( &self, update_type: PermissionUpdateType, policy: PermissionPolicy, metadata_field: Option<MetadataField>, ) -> Result<()>
Set a permission policy on this conversation.
The metadata_field is only used when update_type is
PermissionUpdateType::UpdateMetadata.
Sourcepub fn last_message(&self) -> Result<Option<Message>>
pub fn last_message(&self) -> Result<Option<Message>>
Get the last message in this conversation, if any.
Sourcepub fn remove_admin(&self, inbox_id: &str) -> Result<()>
pub fn remove_admin(&self, inbox_id: &str) -> Result<()>
Remove an admin.
Sourcepub fn add_super_admin(&self, inbox_id: &str) -> Result<()>
pub fn add_super_admin(&self, inbox_id: &str) -> Result<()>
Add a super admin.
Sourcepub fn remove_super_admin(&self, inbox_id: &str) -> Result<()>
pub fn remove_super_admin(&self, inbox_id: &str) -> Result<()>
Remove a super admin.
Sourcepub fn super_admins(&self) -> Vec<String>
pub fn super_admins(&self) -> Vec<String>
Super admin inbox IDs.
Sourcepub fn is_super_admin(&self, inbox_id: &str) -> bool
pub fn is_super_admin(&self, inbox_id: &str) -> bool
Check if the given inbox ID is a super admin.
Sourcepub fn duplicate_dms(&self) -> Result<Vec<Self>>
pub fn duplicate_dms(&self) -> Result<Vec<Self>>
Find duplicate DM conversations for this DM.
Sourcepub fn debug_info(&self) -> Result<ConversationDebugInfo>
pub fn debug_info(&self) -> Result<ConversationDebugInfo>
Get debug information for this conversation.
Sourcepub fn last_read_times(&self) -> Result<Vec<LastReadTime>>
pub fn last_read_times(&self) -> Result<Vec<LastReadTime>>
Get per-inbox last-read timestamps.
Sourcepub fn hmac_keys(&self) -> Result<Vec<HmacKeyEntry>>
pub fn hmac_keys(&self) -> Result<Vec<HmacKeyEntry>>
Get HMAC keys for this conversation (including duplicate DMs).
Source§impl Conversation
impl Conversation
Sourcepub fn send_markdown(&self, markdown: &str) -> Result<String>
pub fn send_markdown(&self, markdown: &str) -> Result<String>
Send a markdown message.
Sourcepub fn send_reaction(
&self,
message_id: &str,
emoji: &str,
action: ReactionAction,
) -> Result<String>
pub fn send_reaction( &self, message_id: &str, emoji: &str, action: ReactionAction, ) -> Result<String>
Send an emoji reaction to a message.
Sourcepub fn send_read_receipt(&self) -> Result<String>
pub fn send_read_receipt(&self) -> Result<String>
Send a read receipt.
Sourcepub fn send_text_reply(&self, reference_id: &str, text: &str) -> Result<String>
pub fn send_text_reply(&self, reference_id: &str, text: &str) -> Result<String>
Send a text reply to a message.
Sourcepub fn send_reply(
&self,
reference_id: &str,
inner_content: &[u8],
) -> Result<String>
pub fn send_reply( &self, reference_id: &str, inner_content: &[u8], ) -> Result<String>
Send a reply with arbitrary encoded content.
Sourcepub fn send_attachment(&self, attachment: &Attachment) -> Result<String>
pub fn send_attachment(&self, attachment: &Attachment) -> Result<String>
Send an inline file attachment.
Sourcepub fn send_remote_attachment(&self, ra: &RemoteAttachment) -> Result<String>
pub fn send_remote_attachment(&self, ra: &RemoteAttachment) -> Result<String>
Send a remote (URL-hosted) encrypted attachment.
Sourcepub fn send_text_optimistic(&self, text: &str) -> Result<String>
pub fn send_text_optimistic(&self, text: &str) -> Result<String>
Optimistically send a plain text message (returns immediately).
Sourcepub fn send_markdown_optimistic(&self, markdown: &str) -> Result<String>
pub fn send_markdown_optimistic(&self, markdown: &str) -> Result<String>
Optimistically send a markdown message.
Sourcepub fn send_reaction_optimistic(
&self,
message_id: &str,
emoji: &str,
action: ReactionAction,
) -> Result<String>
pub fn send_reaction_optimistic( &self, message_id: &str, emoji: &str, action: ReactionAction, ) -> Result<String>
Optimistically send an emoji reaction.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Conversation
impl RefUnwindSafe for Conversation
impl Send for Conversation
impl !Sync for Conversation
impl Unpin for Conversation
impl UnsafeUnpin for Conversation
impl UnwindSafe for Conversation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more