mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-12-29 06:58:50 +00:00
Check if users exists before adding them to a conversation
This commit is contained in:
parent
8527ae9c50
commit
0f856e93cb
@ -84,6 +84,13 @@ pub fn update_settings(r: &mut HttpRequestHandler) -> RequestResult {
|
|||||||
r.forbidden("You can not update the list of members of this conversation!".to_string())?;
|
r.forbidden("You can not update the list of members of this conversation!".to_string())?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the members of the conversation really exists
|
||||||
|
for member in &members {
|
||||||
|
if !user_helper::exists(member.clone())? {
|
||||||
|
r.not_found(format!("User {} not found!", member))?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if !members.contains(&r.user_id()?) {
|
if !members.contains(&r.user_id()?) {
|
||||||
members.push(r.user_id()?);
|
members.push(r.user_id()?);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user