From b1037b2603cc79a75b5bc3b2d317f7800ff212e4 Mon Sep 17 00:00:00 2001 From: Alex Bramley Date: Sat, 5 Nov 2011 06:06:59 +0000 Subject: [PATCH] Add String() method for stateTracker. --- state/tracker.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/state/tracker.go b/state/tracker.go index 1810c6d..27246cd 100644 --- a/state/tracker.go +++ b/state/tracker.go @@ -246,3 +246,19 @@ func (st *stateTracker) Dissociate(ch *Channel, nk *Nick) { } } } + +func (st *stateTracker) String() string { + str := "GoIRC Channels\n" + str += "--------------\n\n" + for _, ch := range st.chans { + str += ch.String() + "\n" + } + str += "GoIRC NickNames\n" + str += "---------------\n\n" + for _, n := range st.nicks { + if n != st.me { + str += n.String() + "\n" + } + } + return str +}