mirror of
https://github.com/aljazceru/notedeck.git
synced 2026-01-13 13:24:20 +01:00
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) => {
|
||||
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 {
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user