1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-20 08:25:16 +00:00

Can set conversation image

This commit is contained in:
2021-03-07 15:06:44 +01:00
parent b43453651f
commit 385a800b7a
5 changed files with 55 additions and 4 deletions

View File

@ -615,6 +615,18 @@ pub trait BaseRequestHandler {
Ok(membership)
}
/// Get information about a conversation included in the request. The user must be an admin
/// of the target conversation
fn post_conv_admin(&mut self, name: &str) -> ResultBoxError<ConversationMember> {
let conv = self.post_conv(name)?;
if !conv.is_admin {
self.forbidden("You are not an administrator of this conversation!".to_string())?;
}
Ok(conv)
}
/// Get the ID
fn post_group_id(&mut self, name: &str) -> ResultBoxError<GroupID> {
let group_id = GroupID::new(self.post_u64(name)?);