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 {