diff --git a/src/controllers/friends_controller.rs b/src/controllers/friends_controller.rs index be14b39..00d0f47 100644 --- a/src/controllers/friends_controller.rs +++ b/src/controllers/friends_controller.rs @@ -4,11 +4,11 @@ use crate::api_data::friend_api::FriendAPI; use crate::api_data::friendship_status_api::FriendshipStatusAPI; -use crate::routes::RequestResult; use crate::data::base_request_handler::BaseRequestHandler; use crate::data::http_request_handler::HttpRequestHandler; use crate::data::notification::NotifEventType; use crate::helpers::{friends_helper, notifications_helper, user_helper}; +use crate::routes::RequestResult; /// Get the list of friends of the current user pub fn get_list(r: &mut HttpRequestHandler) -> RequestResult { @@ -44,7 +44,9 @@ pub fn get_other_user_list(r: &mut HttpRequestHandler) -> RequestResult { r.forbidden("The friend list of this user is not public!".to_string())?; } - let friends = friends_helper::GetFriendsQuery::new(&user_id).exec()?; + let friends = friends_helper::GetFriendsQuery::new(&user_id) + .set_only_accepted(true) + .exec()?; r.set_response(friends.iter().map(|f| f.friend_id.id()).collect::>()) }