mirror of
				https://github.com/ergochat/ergo.git
				synced 2025-10-31 05:47:22 +01:00 
			
		
		
		
	fix #1730
`WHO #channel o` is supposed to return only server operators. This is RFC1459 cruft; just return an empty list in this case.
This commit is contained in:
		
							parent
							
								
									62b2d0341e
								
							
						
					
					
						commit
						2038763e10
					
				| @ -3374,12 +3374,18 @@ func whoHandler(server *Server, client *Client, msg ircmsg.Message, rb *Response | ||||
| 		fields = fields.Add(field) | ||||
| 	} | ||||
| 
 | ||||
| 	//TODO(dan): is this used and would I put this param in the Modern doc? | ||||
| 	// if not, can we remove it? | ||||
| 	//var operatorOnly bool | ||||
| 	//if len(msg.Params) > 1 && msg.Params[1] == "o" { | ||||
| 	//	operatorOnly = true | ||||
| 	//} | ||||
| 	// successfully parsed query, ensure we send the success response: | ||||
| 	defer func() { | ||||
| 		rb.Add(nil, server.name, RPL_ENDOFWHO, client.Nick(), origMask, client.t("End of WHO list")) | ||||
| 	}() | ||||
| 
 | ||||
| 	// XXX #1730: https://datatracker.ietf.org/doc/html/rfc1459#section-4.5.1 | ||||
| 	// 'If the "o" parameter is passed only operators are returned according to | ||||
| 	// the name mask supplied.' | ||||
| 	// see discussion on #1730, we just return no results in this case. | ||||
| 	if len(msg.Params) > 1 && msg.Params[1] == "o" { | ||||
| 		return false | ||||
| 	} | ||||
| 
 | ||||
| 	oper := client.Oper() | ||||
| 	hasPrivs := oper.HasRoleCapab("sajoin") | ||||
| @ -3433,7 +3439,6 @@ func whoHandler(server *Server, client *Client, msg ircmsg.Message, rb *Response | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	rb.Add(nil, server.name, RPL_ENDOFWHO, client.nick, origMask, client.t("End of WHO list")) | ||||
| 	return false | ||||
| } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Shivaram Lingamneni
						Shivaram Lingamneni