hashtag-column: allow multiple hashtags
Changelog-Changed: Allow multiple hashtags in hashtag columns
This commit is contained in:
committed by
William Casarin
parent
5c31bf16c8
commit
f214e97382
@@ -226,18 +226,22 @@ impl Timeline {
|
||||
))
|
||||
}
|
||||
|
||||
pub fn hashtag(hashtag: String) -> Self {
|
||||
let hashtag = hashtag.to_lowercase();
|
||||
let htag: &str = &hashtag;
|
||||
let filter = Filter::new()
|
||||
.kinds([1])
|
||||
.limit(filter::default_limit())
|
||||
.tags([htag], 't')
|
||||
.build();
|
||||
pub fn hashtag(hashtag: Vec<String>) -> Self {
|
||||
let filters = hashtag
|
||||
.iter()
|
||||
.filter(|tag| !tag.is_empty())
|
||||
.map(|tag| {
|
||||
Filter::new()
|
||||
.kinds([1])
|
||||
.limit(filter::default_limit())
|
||||
.tags([tag.as_str()], 't')
|
||||
.build()
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
Timeline::new(
|
||||
TimelineKind::Hashtag(hashtag),
|
||||
FilterState::ready(vec![filter]),
|
||||
FilterState::ready(filters),
|
||||
TimelineTab::only_notes_and_replies(),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user