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:
parent
3b7c469ca4
commit
1484226bfd
@ -30,18 +30,14 @@ pub fn create(conv: &NewConversation) -> Res<ConvID> {
|
||||
.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)
|
||||
|
Loading…
Reference in New Issue
Block a user