1
0
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:
2020-06-30 14:48:39 +02:00
parent f540716b86
commit b15ffe0856
4 changed files with 38 additions and 2 deletions

View File

@ -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 {