degesch: fix /mode on servers with +channels
This commit is contained in:
		
							parent
							
								
									9027889002
								
							
						
					
					
						commit
						a0b98720b9
					
				
							
								
								
									
										11
									
								
								degesch.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								degesch.c
									
									
									
									
									
								
							| @ -6317,9 +6317,16 @@ handle_command_mode (struct app_context *ctx, char *arguments) | |||||||
| 		return true; | 		return true; | ||||||
| 
 | 
 | ||||||
| 	// FIXME: allow usernames as well, not only channels
 | 	// FIXME: allow usernames as well, not only channels
 | ||||||
| 	// FIXME: +channels collide with setting modes
 |  | ||||||
| 	struct server *s = ctx->current_buffer->server; | 	struct server *s = ctx->current_buffer->server; | ||||||
| 	char *channel_name = try_get_channel (ctx, &arguments); | 
 | ||||||
|  | 	// Channel names prefixed by "+" collide with mode strings,
 | ||||||
|  | 	// so we just disallow specifying these channels
 | ||||||
|  | 	char *channel_name = NULL; | ||||||
|  | 	if (*arguments != '+') | ||||||
|  | 		channel_name = maybe_cut_word (&arguments, validate_channel_name, s); | ||||||
|  | 	if (!channel_name && ctx->current_buffer->type == BUFFER_CHANNEL) | ||||||
|  | 		channel_name = ctx->current_buffer->channel->name; | ||||||
|  | 
 | ||||||
| 	if (!channel_name) | 	if (!channel_name) | ||||||
| 		buffer_send_error (ctx, ctx->current_buffer, | 		buffer_send_error (ctx, ctx->current_buffer, | ||||||
| 			"%s: %s", "Can't set mode", | 			"%s: %s", "Can't set mode", | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user