This commit is contained in:
kayos@tcp.direct 2022-10-23 01:56:07 -07:00
parent d91de1c3c0
commit 5f71c07dee
Signed by: kayos
GPG Key ID: 4B841471B4BEE979

View File

@ -119,13 +119,14 @@ func (c *CModes) Get(mode string) (args string, ok bool) {
}
// hasArg checks to see if the mode supports arguments. What ones support this?:
// A = Mode that adds or removes a nick or address to a list. Always has a parameter.
// B = Mode that changes a setting and always has a parameter.
// C = Mode that changes a setting and only has a parameter when set.
// D = Mode that changes a setting and never has a parameter.
// Note: Modes of type A return the list when there is no parameter present.
// Note: Some clients assumes that any mode not listed is of type D.
// Note: Modes in PREFIX are not listed but could be considered type B.
//
// A = Mode that adds or removes a nick or address to a list. Always has a parameter.
// B = Mode that changes a setting and always has a parameter.
// C = Mode that changes a setting and only has a parameter when set.
// D = Mode that changes a setting and never has a parameter.
// Note: Modes of type A return the list when there is no parameter present.
// Note: Some clients assumes that any mode not listed is of type D.
// Note: Modes in PREFIX are not listed but could be considered type B.
func (c *CModes) hasArg(set bool, mode byte) (hasArgs, isSetting bool) {
if len(c.raw) < 1 {
return false, true
@ -458,7 +459,7 @@ type Perms struct {
// IsAdmin indicates that the user has banning abilities, and are likely a
// very trustable user (e.g. op+).
func (m Perms) IsAdmin() bool {
func (m *Perms) IsAdmin() bool {
if m.Owner || m.Admin || m.Op {
return true
}
@ -468,7 +469,7 @@ func (m Perms) IsAdmin() bool {
// IsTrusted indicates that the user at least has modes set upon them, higher
// than a regular joining user.
func (m Perms) IsTrusted() bool {
func (m *Perms) IsTrusted() bool {
if m.IsAdmin() || m.HalfOp || m.Voice {
return true
}