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

fix(crypto): Redecrypt non-UTD messages to remove no-longer-relevant warning shields #4644

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::sync::Arc;

use eyeball_im::VectorDiff;
use itertools::Itertools as _;
use matrix_sdk::deserialized_responses::TimelineEvent;
Expand All @@ -32,7 +34,7 @@ use super::{
ObservableItems, ObservableItemsTransaction, TimelineFocusKind, TimelineMetadata,
TimelineSettings,
};
use crate::events::SyncTimelineEventWithoutContent;
use crate::{events::SyncTimelineEventWithoutContent, timeline::TimelineItem};

pub(in crate::timeline) struct TimelineStateTransaction<'a> {
/// A vector transaction over the items themselves. Holds temporary state
Expand Down Expand Up @@ -441,6 +443,14 @@ impl<'a> TimelineStateTransaction<'a> {
}
}

pub(super) fn replace(
&mut self,
timeline_item_index: usize,
timeline_item: Arc<TimelineItem>,
) -> Arc<TimelineItem> {
self.items.replace(timeline_item_index, timeline_item)
}

pub(super) fn clear(&mut self) {
let has_local_echoes = self.items.iter().any(|item| item.is_local_echo());

Expand Down