Skip to content
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

ui: Improvements for replies and edits #3627

Merged
merged 4 commits into from
Jul 1, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ui: Docs fixes
Signed-off-by: Kévin Commaille <[email protected]>
zecakeh committed Jun 30, 2024

Verified

This commit was signed with the committer’s verified signature.
zecakeh Kévin Commaille
commit 6d703999ee16548357442dd39554fff61ad71111
21 changes: 14 additions & 7 deletions crates/matrix-sdk-ui/src/timeline/mod.rs
Original file line number Diff line number Diff line change
@@ -418,7 +418,7 @@ impl Timeline {
Ok(())
}

/// Gives the information needed to reply to an event from an event id.
/// Get the information needed to reply to the event with the given ID.
pub async fn replied_to_info_from_event_id(
&self,
event_id: &EventId,
@@ -468,17 +468,24 @@ impl Timeline {
})
}

/// Send an edit to the given event.
/// Edit an event.
///
/// Currently only supports `m.room.message` events whose event ID is known.
/// Please check [`EventTimelineItem::is_editable`] before calling this.
/// Only supports events for which [`EventTimelineItem::is_editable()`]
/// returns `true`.
///
/// # Arguments
///
/// * `new_content` - The content of the reply
/// * `new_content` - The new content of the event.
///
/// * `edit_info` - A wrapper that contains the event ID and the content of
/// the event to edit
/// the event to edit.
///
/// # Returns
///
/// Returns `Ok(true)` if the edit was added to the send queue. Returns
/// `Ok(false)` if the edit targets a local item but the edit could not be
/// applied, which could mean that the event was already sent. Returns an
/// error if there was an issue adding the edit to the send queue.
#[instrument(skip(self, new_content))]
pub async fn edit(
&self,
@@ -536,7 +543,7 @@ impl Timeline {
Ok(true)
}

/// Give the information needed to edit an event from an event id.
/// Get the information needed to edit the event with the given ID.
pub async fn edit_info_from_event_id(
&self,
event_id: &EventId,