mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 13:36:59 +00:00
@@ -242,7 +242,12 @@ impl Channel {
|
||||
/// Add user to a group
|
||||
pub async fn add_user_to_group(&mut self, db: &Database, user: &str, by: &str) -> Result<()> {
|
||||
if let Channel::Group { recipients, .. } = self {
|
||||
recipients.push(user.to_string());
|
||||
let user = user.to_string();
|
||||
if recipients.contains(&user) {
|
||||
return Err(Error::AlreadyInGroup);
|
||||
}
|
||||
|
||||
recipients.push(user);
|
||||
}
|
||||
|
||||
match &self {
|
||||
|
||||
Reference in New Issue
Block a user