1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-25 23:09:22 +00:00

Fix order server message are sent when creating a conversation

This commit is contained in:
Pierre HUBERT 2021-03-10 19:04:47 +01:00
parent 3b7c469ca4
commit 1484226bfd

View File

@ -30,18 +30,14 @@ pub fn create(conv: &NewConversation) -> Res<ConvID> {
.map(|i| ConvID::new(i)) .map(|i| ConvID::new(i))
.ok_or(ExecError::new("missing result conv id!"))?; .ok_or(ExecError::new("missing result conv id!"))?;
// Add the members to the conversation // Add the creator of the conversation
add_member(conv_id, &conv.owner_id, conv.owner_following, true, &conv.owner_id);
// Add other members to the conversation
for member in &conv.members { for member in &conv.members {
if !member.eq(&conv.owner_id) {
// Check following status of the member add_member(conv_id, member, true, false, &conv.owner_id)?;
let mut follow = true;
let mut admin = false;
if member.eq(&conv.owner_id) {
follow = conv.owner_following;
admin = true;
} }
add_member(conv_id, member, follow, admin, &conv.owner_id)?;
} }
Ok(conv_id) Ok(conv_id)