diff --git a/src/timeline/kind.rs b/src/timeline/kind.rs index 05b5d04..5196081 100644 --- a/src/timeline/kind.rs +++ b/src/timeline/kind.rs @@ -129,18 +129,7 @@ impl TimelineKind { )) } - TimelineKind::Hashtag(hashtag) => { - let filter = Filter::new() - .kinds([1]) - .limit(filter::default_limit()) - .tags([hashtag.clone()], 't') - .build(); - - Some(Timeline::new( - TimelineKind::Hashtag(hashtag), - FilterState::ready(vec![filter]), - )) - } + TimelineKind::Hashtag(hashtag) => Some(Timeline::hashtag(hashtag)), TimelineKind::List(ListKind::Contact(pk_src)) => { let pk = match &pk_src { diff --git a/src/timeline/mod.rs b/src/timeline/mod.rs index ca7a76b..c31e5a5 100644 --- a/src/timeline/mod.rs +++ b/src/timeline/mod.rs @@ -207,6 +207,19 @@ impl Timeline { )) } + pub fn hashtag(hashtag: String) -> Self { + let filter = Filter::new() + .kinds([1]) + .limit(filter::default_limit()) + .tags([hashtag.clone()], 't') + .build(); + + Timeline::new( + TimelineKind::Hashtag(hashtag), + FilterState::ready(vec![filter]), + ) + } + pub fn make_view_id(id: TimelineId, selected_view: i32) -> egui::Id { egui::Id::new((id, selected_view)) }