add: reposts/quotes pages
add: repost notification
This commit is contained in:
parent
41250ef7ed
commit
276f25a496
17 changed files with 601 additions and 50 deletions
|
@ -46,11 +46,19 @@ impl DataManager {
|
|||
auto_method!(get_question_by_id()@get_question_from_row -> "SELECT * FROM questions WHERE id = $1" --name="question" --returns=Question --cache-key-tmpl="atto.question:{}");
|
||||
|
||||
/// Fill the given vector of questions with their owner as well.
|
||||
pub async fn fill_questions(&self, questions: Vec<Question>) -> Result<Vec<(Question, User)>> {
|
||||
pub async fn fill_questions(
|
||||
&self,
|
||||
questions: Vec<Question>,
|
||||
ignore_users: &Vec<usize>,
|
||||
) -> Result<Vec<(Question, User)>> {
|
||||
let mut out: Vec<(Question, User)> = Vec::new();
|
||||
|
||||
let mut seen_users: HashMap<usize, User> = HashMap::new();
|
||||
for question in questions {
|
||||
if ignore_users.contains(&question.owner) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if let Some(ua) = seen_users.get(&question.owner) {
|
||||
out.push((question, ua.to_owned()));
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue