feat: allow to set an icon when creating a group
Signed-off-by: Nils Ponsard <nilsponsard@gmail.com>
This commit is contained in:
@@ -279,16 +279,24 @@ impl Channel {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let id = ulid::Ulid::new().to_string();
|
||||||
|
|
||||||
|
let icon = if let Some(icon_id) = data.icon {
|
||||||
|
Some(File::use_channel_icon(db, &icon_id, &id, &owner_id).await?)
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
let recipients = data.users.into_iter().collect::<Vec<String>>();
|
let recipients = data.users.into_iter().collect::<Vec<String>>();
|
||||||
let channel = Channel::Group {
|
let channel = Channel::Group {
|
||||||
id: ulid::Ulid::new().to_string(),
|
id,
|
||||||
|
|
||||||
name: data.name,
|
name: data.name,
|
||||||
owner: owner_id,
|
owner: owner_id,
|
||||||
description: data.description,
|
description: data.description,
|
||||||
recipients: recipients.clone(),
|
recipients: recipients.clone(),
|
||||||
|
|
||||||
icon: None,
|
icon,
|
||||||
last_message_id: None,
|
last_message_id: None,
|
||||||
|
|
||||||
permissions: None,
|
permissions: None,
|
||||||
|
|||||||
Reference in New Issue
Block a user