From 53846d1e34aed82b50b146b0ca265ed1c82e7539 Mon Sep 17 00:00:00 2001 From: mattn Date: Tue, 12 Feb 2013 10:43:33 +0900 Subject: [PATCH] fixed #17 --- example/example.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/example/example.go b/example/example.go index c5887c0..cb6911d 100644 --- a/example/example.go +++ b/example/example.go @@ -57,7 +57,12 @@ func main() { if err != nil { log.Fatal(err) } - fmt.Println(chat.Remote, fromUTF8(chat.Text)) + switch v := chat.(type) { + case xmpp.Chat: + fmt.Println(v.Remote, fromUTF8(v.Text)) + case xmpp.Presence: + fmt.Println(v.From, fromUTF8(v.Show)) + } } }() for {