Added ClientMode.Prefix() function
This commit is contained in:
parent
0017e3f574
commit
0ad0dd2989
@ -98,11 +98,7 @@ func (c *Client) joinChannel(channelName string) {
|
||||
|
||||
nickKey := strings.ToLower(client.nick)
|
||||
if mode, exists := channel.modeMap[nickKey]; exists {
|
||||
if mode.operator {
|
||||
prefix = "@"
|
||||
} else if mode.voice {
|
||||
prefix = "+"
|
||||
}
|
||||
prefix = mode.Prefix()
|
||||
}
|
||||
|
||||
nicks = append(nicks, fmt.Sprintf("%s%s", prefix, client.nick))
|
||||
|
10
rosella.go
10
rosella.go
@ -65,6 +65,16 @@ type ClientMode struct {
|
||||
voice bool //Has voice
|
||||
}
|
||||
|
||||
func (m *ClientMode) Prefix() string {
|
||||
if m.operator {
|
||||
return "@"
|
||||
} else if m.voice {
|
||||
return "+"
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
type signalCode int
|
||||
|
||||
const (
|
||||
|
Loading…
Reference in New Issue
Block a user