Browse Source

fix #1730

`WHO #channel o` is supposed to return only server operators.
This is RFC1459 cruft; just return an empty list in this case.
tags/v2.9.0-rc1
Shivaram Lingamneni 2 years ago
parent
commit
2038763e10
1 changed files with 12 additions and 7 deletions
  1. 12
    7
      irc/handlers.go

+ 12
- 7
irc/handlers.go View File

3374
 		fields = fields.Add(field)
3374
 		fields = fields.Add(field)
3375
 	}
3375
 	}
3376
 
3376
 
3377
-	//TODO(dan): is this used and would I put this param in the Modern doc?
3378
-	// if not, can we remove it?
3379
-	//var operatorOnly bool
3380
-	//if len(msg.Params) > 1 && msg.Params[1] == "o" {
3381
-	//	operatorOnly = true
3382
-	//}
3377
+	// successfully parsed query, ensure we send the success response:
3378
+	defer func() {
3379
+		rb.Add(nil, server.name, RPL_ENDOFWHO, client.Nick(), origMask, client.t("End of WHO list"))
3380
+	}()
3381
+
3382
+	// XXX #1730: https://datatracker.ietf.org/doc/html/rfc1459#section-4.5.1
3383
+	// 'If the "o" parameter is passed only operators are returned according to
3384
+	// the name mask supplied.'
3385
+	// see discussion on #1730, we just return no results in this case.
3386
+	if len(msg.Params) > 1 && msg.Params[1] == "o" {
3387
+		return false
3388
+	}
3383
 
3389
 
3384
 	oper := client.Oper()
3390
 	oper := client.Oper()
3385
 	hasPrivs := oper.HasRoleCapab("sajoin")
3391
 	hasPrivs := oper.HasRoleCapab("sajoin")
3433
 		}
3439
 		}
3434
 	}
3440
 	}
3435
 
3441
 
3436
-	rb.Add(nil, server.name, RPL_ENDOFWHO, client.nick, origMask, client.t("End of WHO list"))
3437
 	return false
3442
 	return false
3438
 }
3443
 }
3439
 
3444
 

Loading…
Cancel
Save