From 0017e3f57402b8a75bdd132584192a94b9c7b2fa Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Wed, 28 Aug 2013 16:36:40 +0100 Subject: [PATCH] Added ChannelMode.String() function --- rosella.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/rosella.go b/rosella.go index 4b71ab2..e42c59f 100644 --- a/rosella.go +++ b/rosella.go @@ -43,6 +43,23 @@ type ChannelMode struct { 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 { operator bool //Channel operator voice bool //Has voice