Add a fqn field to blogs and users (#457)

Fixes #319
This commit is contained in:
Baptiste Gelez
2019-03-06 18:28:10 +01:00
committed by GitHub
parent eff2698664
commit fe6e69d7c4
39 changed files with 258 additions and 141 deletions
+2 -2
View File
@@ -46,14 +46,14 @@ pub fn details(blog: String, slug: String, conn: DbConn, user: Option<User>, res
warning: previous.clone().map(|p| p.spoiler_text).unwrap_or_default(),
content: previous.clone().and_then(|p| Some(format!(
"@{} {}",
p.get_author(&*conn).ok()?.get_fqn(&*conn),
p.get_author(&*conn).ok()?.fqn,
Mention::list_for_comment(&*conn, p.id).ok()?
.into_iter()
.filter_map(|m| {
let user = user.clone();
if let Ok(mentioned) = m.get_mentioned(&*conn) {
if user.is_none() || mentioned.id != user.expect("posts::details_response: user error while listing mentions").id {
Some(format!("@{}", mentioned.get_fqn(&*conn)))
Some(format!("@{}", mentioned.fqn))
} else {
None
}