1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-21 17:05:16 +00:00

Update can_post_texts parameter

This commit is contained in:
2020-06-30 14:54:45 +02:00
parent b15ffe0856
commit d195979c18
3 changed files with 21 additions and 0 deletions

View File

@ -172,6 +172,15 @@ pub fn set_following(user_id: &UserID, friend_id: &UserID, follow: bool) -> Resu
.exec()
}
/// Specify whether a friend is allowed to create posts on current user's page or not
pub fn set_can_post_texts(user_id: &UserID, friend_id: &UserID, allow: bool) -> ResultBoxError {
database::UpdateInfo::new(FRIENDS_TABLE)
.cond_user_id("ID_personne", user_id)
.cond_user_id("ID_amis", friend_id)
.set_legacy_bool("autoriser_post_page", allow)
.exec()
}
/// Get the status of a friendship
pub fn get_status(user_id: &UserID, friend_id: &UserID) -> ResultBoxError<FriendshipStatus> {
let mut status = FriendshipStatus {