fn single_id(&self) -> String {
panic!("Should only call this if the FileType sets CAN_LIST, CAN_GET_POSTS or IS_EXAMINE_USER");
}
+
+ fn want_to_jump_to_new_content(&self) -> bool {
+ false
+ }
}
struct FeedSource {
fn extendable(&self) -> bool {
true
}
+
+ fn want_to_jump_to_new_content(&self) -> bool {
+ self.id == FeedId::Mentions
+ }
}
struct StaticSource {
Err(..) => LogicalAction::Beep,
}
}
+
+ fn show_new_content(&mut self, client: &mut Client) {
+ self.contents.update_items(client);
+ if let Some(index) = self.latest_read_index {
+ if self.contents.last_index() > index {
+ self.pos = FilePosition::item_top(index + 1);
+ self.ensure_enough_rendered();
+ self.after_setting_pos();
+ }
+ }
+ }
}
pub fn home_timeline(
fn save_file_position(&self) -> Option<(FeedId, SavedFilePos)> {
None
}
+ fn show_new_content(&mut self, _client: &mut Client) {}
fn got_search_expression(
&mut self,
_dir: SearchDirection,
post: Option<Post>,
is_interrupt: bool,
) {
- if !self.activity_states.contains_key(&act) {
+ if let Some(ref mut state) = self.activity_states.get_mut(&act) {
+ state.show_new_content(client);
+ } else {
self.activity_states.insert(
act.clone(),
self.new_activity_state(act, client, post, is_interrupt),