Always show retweets unless excluded in search
This commit is contained in:
@@ -21,8 +21,9 @@ proc showRss*(req: Request; hostname: string; query: Query): Future[Rss] {.async
|
||||
(profile, timeline) =
|
||||
await fetchSingleTimeline(after, query, skipRail=true)
|
||||
else:
|
||||
let multiQuery = query.getMultiQuery(names)
|
||||
timeline = await getSearch[Tweet](multiQuery, after)
|
||||
var q = query
|
||||
q.fromUser = names
|
||||
timeline = await getSearch[Tweet](q, after)
|
||||
# this is kinda dumb
|
||||
profile = Profile(
|
||||
username: name,
|
||||
|
||||
@@ -13,7 +13,7 @@ export search
|
||||
proc createSearchRouter*(cfg: Config) =
|
||||
router search:
|
||||
get "/search/?":
|
||||
if @"q".len > 200:
|
||||
if @"q".len > 500:
|
||||
resp Http400, showError("Search input too long.", cfg)
|
||||
|
||||
let
|
||||
|
||||
@@ -73,12 +73,6 @@ proc fetchSingleTimeline*(after: string; query: Query; skipRail=false):
|
||||
|
||||
return (profile, timeline, await rail)
|
||||
|
||||
proc getMultiQuery*(q: Query; names: seq[string]): Query =
|
||||
result = q
|
||||
result.fromUser = names
|
||||
if q.kind == posts and "replies" notin q.excludes:
|
||||
result.excludes.add "replies"
|
||||
|
||||
proc get*(req: Request; key: string): string =
|
||||
params(req).getOrDefault(key)
|
||||
|
||||
@@ -118,7 +112,7 @@ proc createTimelineRouter*(cfg: Config) =
|
||||
|
||||
var query = request.getQuery(@"tab", @"name")
|
||||
if names.len != 1:
|
||||
query = query.getMultiQuery(names)
|
||||
query.fromUser = names
|
||||
|
||||
if @"scroll".len > 0:
|
||||
if query.fromUser.len != 1:
|
||||
|
||||
Reference in New Issue
Block a user