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)
|
nickKey := strings.ToLower(client.nick)
|
||||||
if mode, exists := channel.modeMap[nickKey]; exists {
|
if mode, exists := channel.modeMap[nickKey]; exists {
|
||||||
if mode.operator {
|
prefix = mode.Prefix()
|
||||||
prefix = "@"
|
|
||||||
} else if mode.voice {
|
|
||||||
prefix = "+"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nicks = append(nicks, fmt.Sprintf("%s%s", prefix, client.nick))
|
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
|
voice bool //Has voice
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *ClientMode) Prefix() string {
|
||||||
|
if m.operator {
|
||||||
|
return "@"
|
||||||
|
} else if m.voice {
|
||||||
|
return "+"
|
||||||
|
} else {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
type signalCode int
|
type signalCode int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
Loading…
Reference in New Issue
Block a user