Added ChannelMode.String() function

This commit is contained in:
Harry Jeffery 2013-08-28 16:36:40 +01:00
parent 3f325e6652
commit 0017e3f574

View File

@ -43,6 +43,23 @@ type ChannelMode struct {
moderated bool //Only ops and voiced may speak moderated bool //Only ops and voiced may speak
} }
func (m *ChannelMode) String() string {
modeStr := ""
if m.anonymous {
modeStr += "a"
}
if m.secret {
modeStr += "s"
}
if m.topicLocked {
modeStr += "t"
}
if m.moderated {
modeStr += "m"
}
return modeStr
}
type ClientMode struct { type ClientMode struct {
operator bool //Channel operator operator bool //Channel operator
voice bool //Has voice voice bool //Has voice