|  |  | @ -379,19 +379,15 @@ impl<'a> ProcessMention<'a> { | 
			
		
	
		
		
			
				
					
					|  |  |  |     async fn cmd_add_member(&mut self, user: &str) -> Result<(), GroupError> { |  |  |  |     async fn cmd_add_member(&mut self, user: &str) -> Result<(), GroupError> { | 
			
		
	
		
		
			
				
					
					|  |  |  |         let u = normalize_acct(user, &self.group_acct)?; |  |  |  |         let u = normalize_acct(user, &self.group_acct)?; | 
			
		
	
		
		
			
				
					
					|  |  |  |         if self.is_admin { |  |  |  |         if self.is_admin { | 
			
		
	
		
		
			
				
					
					|  |  |  |             if !self.config.is_member(&u) { |  |  |  |             match self.config.set_member(&u, true) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 match self.config.set_member(&u, true) { |  |  |  |                 Ok(_) => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     Ok(_) => { |  |  |  |                     self.add_reply(format!("User {} added to the group!", u)); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         self.add_reply(format!("User {} added to the group!", u)); |  |  |  |                     self.follow_by_acct(&u) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         self.follow_by_acct(&u) |  |  |  |                         .await.log_error("Failed to follow"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             .await.log_error("Failed to follow"); |  |  |  |                 } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                 Err(e) => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     Err(e) => { |  |  |  |                     self.add_reply(format!("Failed to add user {} to group: {}", u, e)); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         self.add_reply(format!("Failed to add user {} to group: {}", u, e)); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |             } else { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 debug!("User was already a member"); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } else { |  |  |  |         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.add_reply("Only admins can manage members"); |  |  |  |             self.add_reply("Only admins can manage members"); | 
			
		
	
	
		
		
			
				
					|  |  | @ -402,16 +398,14 @@ impl<'a> ProcessMention<'a> { | 
			
		
	
		
		
			
				
					
					|  |  |  |     async fn cmd_remove_member(&mut self, user: &str) -> Result<(), GroupError> { |  |  |  |     async fn cmd_remove_member(&mut self, user: &str) -> Result<(), GroupError> { | 
			
		
	
		
		
			
				
					
					|  |  |  |         let u = normalize_acct(user, &self.group_acct)?; |  |  |  |         let u = normalize_acct(user, &self.group_acct)?; | 
			
		
	
		
		
			
				
					
					|  |  |  |         if self.is_admin { |  |  |  |         if self.is_admin { | 
			
		
	
		
		
			
				
					
					|  |  |  |             if self.config.is_member(&u) { |  |  |  |             match self.config.set_member(&u, false) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                 match self.config.set_member(&u, false) { |  |  |  |                 Ok(_) => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     Ok(_) => { |  |  |  |                     self.add_reply(format!("User {} removed from the group.", u)); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         self.add_reply(format!("User {} removed from the group.", u)); |  |  |  |                     self.unfollow_by_acct(&u).await | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         self.unfollow_by_acct(&u).await |  |  |  |                         .log_error("Failed to unfollow removed user"); | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                             .log_error("Failed to unfollow removed user"); |  |  |  |                 } | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |                 Err(_) => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                     Err(_) => { |  |  |  |                     unreachable!() | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |                         unreachable!() |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                     } |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |                 } |  |  |  |                 } | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  |         } else { |  |  |  |         } else { | 
			
		
	
	
		
		
			
				
					|  |  | @ -586,9 +580,10 @@ impl<'a> ProcessMention<'a> { | 
			
		
	
		
		
			
				
					
					|  |  |  |             // admin can leave but that's a bad idea
 |  |  |  |             // admin can leave but that's a bad idea
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             let _ = self.config.set_member(&self.status_acct, false); |  |  |  |             let _ = self.config.set_member(&self.status_acct, false); | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.add_reply("You're no longer a group member. Unfollow the group user to stop receiving group messages."); |  |  |  |             self.add_reply("You're no longer a group member. Unfollow the group user to stop receiving group messages."); | 
			
		
	
		
		
			
				
					
					|  |  |  |             self.unfollow_user_by_id(&self.status_user_id).await |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |                 .log_error("Failed to unfollow"); |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         self.unfollow_user_by_id(&self.status_user_id).await | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             .log_error("Failed to unfollow"); | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     async fn cmd_join(&mut self) { |  |  |  |     async fn cmd_join(&mut self) { | 
			
		
	
	
		
		
			
				
					|  |  | 
 |