mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-22 01:15:16 +00:00
Can update following status
This commit is contained in:
@ -163,6 +163,15 @@ pub fn is_following(user_id: &UserID, friend_id: &UserID) -> ResultBoxError<bool
|
||||
.map(|f| f > 0)
|
||||
}
|
||||
|
||||
/// Update following status of a friendship
|
||||
pub fn set_following(user_id: &UserID, friend_id: &UserID, follow: bool) -> ResultBoxError {
|
||||
database::UpdateInfo::new(FRIENDS_TABLE)
|
||||
.cond_user_id("ID_personne", user_id)
|
||||
.cond_user_id("ID_amis", friend_id)
|
||||
.set_legacy_bool("abonnement", follow)
|
||||
.exec()
|
||||
}
|
||||
|
||||
/// Get the status of a friendship
|
||||
pub fn get_status(user_id: &UserID, friend_id: &UserID) -> ResultBoxError<FriendshipStatus> {
|
||||
let mut status = FriendshipStatus {
|
||||
|
Reference in New Issue
Block a user