diff --git a/src/helpers/conversations_helper.rs b/src/helpers/conversations_helper.rs index f7ca1b0..9fd7f7b 100644 --- a/src/helpers/conversations_helper.rs +++ b/src/helpers/conversations_helper.rs @@ -30,18 +30,14 @@ pub fn create(conv: &NewConversation) -> Res { .map(|i| ConvID::new(i)) .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 { - - // Check following status of the member - let mut follow = true; - let mut admin = false; - if member.eq(&conv.owner_id) { - follow = conv.owner_following; - admin = true; + if !member.eq(&conv.owner_id) { + add_member(conv_id, member, true, false, &conv.owner_id)?; } - - add_member(conv_id, member, follow, admin, &conv.owner_id)?; } Ok(conv_id)