X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fapi%2Fsrc%2Flocal_user%2Fnotifications%2Flist_mentions.rs;h=46b11f60512909f79a1a8be1e374e816c1d96db3;hb=c8063f3267cf2b3622f1fdc69128c6b55feefbbc;hp=fbafdb52aa58e2caa338199af8c4762f31301355;hpb=a5707328cff0133373491ef8e8908faeefacfa30;p=lemmy.git diff --git a/crates/api/src/local_user/notifications/list_mentions.rs b/crates/api/src/local_user/notifications/list_mentions.rs index fbafdb52..46b11f60 100644 --- a/crates/api/src/local_user/notifications/list_mentions.rs +++ b/crates/api/src/local_user/notifications/list_mentions.rs @@ -6,17 +6,16 @@ use lemmy_api_common::{ utils::local_user_view_from_jwt, }; use lemmy_db_views_actor::person_mention_view::PersonMentionQuery; -use lemmy_utils::{error::LemmyError, ConnectionId}; +use lemmy_utils::error::LemmyError; #[async_trait::async_trait(?Send)] impl Perform for GetPersonMentions { type Response = GetPersonMentionsResponse; - #[tracing::instrument(skip(context, _websocket_id))] + #[tracing::instrument(skip(context))] async fn perform( &self, context: &Data, - _websocket_id: Option, ) -> Result { let data: &GetPersonMentions = self; let local_user_view = local_user_view_from_jwt(&data.auth, context).await?; @@ -24,22 +23,21 @@ impl Perform for GetPersonMentions { let sort = data.sort; let page = data.page; let limit = data.limit; - let unread_only = data.unread_only; + let unread_only = data.unread_only.unwrap_or_default(); let person_id = Some(local_user_view.person.id); - let show_bot_accounts = Some(local_user_view.local_user.show_bot_accounts); + let show_bot_accounts = local_user_view.local_user.show_bot_accounts; - let mentions = PersonMentionQuery::builder() - .pool(context.pool()) - .recipient_id(person_id) - .my_person_id(person_id) - .sort(sort) - .unread_only(unread_only) - .show_bot_accounts(show_bot_accounts) - .page(page) - .limit(limit) - .build() - .list() - .await?; + let mentions = PersonMentionQuery { + recipient_id: person_id, + my_person_id: person_id, + sort, + unread_only, + show_bot_accounts, + page, + limit, + } + .list(&mut context.pool()) + .await?; Ok(GetPersonMentionsResponse { mentions }) }