timeline: add simple hashtag timeline constructor
Useful for adding hashtag timelines manually without the into_timeline thing Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -129,18 +129,7 @@ impl TimelineKind {
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
TimelineKind::Hashtag(hashtag) => {
|
TimelineKind::Hashtag(hashtag) => Some(Timeline::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::List(ListKind::Contact(pk_src)) => {
|
TimelineKind::List(ListKind::Contact(pk_src)) => {
|
||||||
let pk = match &pk_src {
|
let pk = match &pk_src {
|
||||||
|
|||||||
@@ -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 {
|
pub fn make_view_id(id: TimelineId, selected_view: i32) -> egui::Id {
|
||||||
egui::Id::new((id, selected_view))
|
egui::Id::new((id, selected_view))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user