Function update_latest_event

Source
pub fn update_latest_event(
    room_id: OwnedRoomId,
    event_tl_item: &EventTimelineItem,
    timeline_update_sender: Option<&Sender<TimelineUpdate>>,
) -> bool
Expand description

Handles the given updated latest event for the given room.

This currently includes checking the given event for:

  • room name changes, in which it sends a RoomsListUpdate.
  • room power level changes to see if the current user’s permissions have changed; if so, it sends a TimelineUpdate::UserPowerLevels.
  • room avatar changes, which is not handled here. Instead, we return true such that other code can fetch the new avatar.
  • membership changes to see if the current user has joined or left a room.

Finally, this function sends a RoomsListUpdate::UpdateLatestEvent to update the latest event in the RoomsList’s room preview for the given room.

Returns true if room avatar has changed and should be fetched and updated.