Add pretty site names to search and thread views
This commit is contained in:
parent
ec41f840d5
commit
79db94f67f
@ -1,6 +1,13 @@
|
||||
SELECT
|
||||
*
|
||||
date,
|
||||
is_read,
|
||||
link,
|
||||
site,
|
||||
summary,
|
||||
title,
|
||||
name
|
||||
FROM
|
||||
post
|
||||
post p
|
||||
JOIN feed f ON p.site = f.slug
|
||||
WHERE
|
||||
uid = $1
|
||||
|
||||
@ -1,7 +1,12 @@
|
||||
SELECT
|
||||
*
|
||||
date,
|
||||
is_read,
|
||||
title,
|
||||
uid,
|
||||
name
|
||||
FROM
|
||||
post
|
||||
post p
|
||||
JOIN feed f ON p.site = f.slug
|
||||
WHERE
|
||||
site = $1
|
||||
AND (
|
||||
|
||||
@ -70,8 +70,7 @@ pub async fn search(
|
||||
date_relative: "TODO date_relative".to_string(),
|
||||
matched: 0,
|
||||
total: 1,
|
||||
// TODO: join with feed table and get pretty name
|
||||
authors: site.clone(),
|
||||
authors: r.name.unwrap_or_else(|| site.clone()),
|
||||
subject: r.title.unwrap_or("NO TITLE".to_string()),
|
||||
tags,
|
||||
}
|
||||
@ -135,7 +134,7 @@ pub async fn thread(pool: &PgPool, thread_id: String) -> Result<Thread, ServerEr
|
||||
});
|
||||
let title = r.title.unwrap_or("NO TITLE".to_string());
|
||||
let from = Some(Email {
|
||||
name: Some(site.clone()),
|
||||
name: r.name,
|
||||
addr: r.link,
|
||||
});
|
||||
Ok(Thread {
|
||||
@ -143,7 +142,6 @@ pub async fn thread(pool: &PgPool, thread_id: String) -> Result<Thread, ServerEr
|
||||
subject: title.clone(),
|
||||
messages: vec![Message {
|
||||
id,
|
||||
// TODO: join with feed for pretty site name
|
||||
from,
|
||||
to: Vec::new(),
|
||||
cc: Vec::new(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user