diff options
Diffstat (limited to 'connector/xmpp')
-rw-r--r-- | connector/xmpp/xmpp.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/connector/xmpp/xmpp.go b/connector/xmpp/xmpp.go index e50bb58..caeb993 100644 --- a/connector/xmpp/xmpp.go +++ b/connector/xmpp/xmpp.go @@ -249,7 +249,6 @@ func (xm *XMPP) handleXMPP() error { DisplayName: remote[1], }) } - // Do nothing. } } } @@ -264,11 +263,14 @@ func (xm *XMPP) SetUserInfo(info *UserInfo) error { func (xm *XMPP) SetRoomInfo(roomId RoomID, info *RoomInfo) error { if info.Topic != "" { - xm.conn.Send(gxmpp.Chat{ + _, err := xm.conn.Send(gxmpp.Chat{ Type: "groupchat", Remote: string(roomId), Subject: info.Topic, }) + if err != nil { + return err + } } if info.Picture != nil { @@ -297,25 +299,25 @@ func (xm *XMPP) Invite(userId UserID, roomId RoomID) error { } func (xm *XMPP) Leave(roomId RoomID) { - // TODO + xm.conn.LeaveMUC(string(roomId)) } func (xm *XMPP) Send(event *Event) error { fmt.Printf("xm *XMPP Send %#v\n", event) if len(event.Recipient) > 0 { - xm.conn.Send(gxmpp.Chat{ + _, err := xm.conn.Send(gxmpp.Chat{ Type: "chat", Remote: string(event.Recipient), Text: event.Text, }) - return nil + return err } else if len(event.Room) > 0 { - xm.conn.Send(gxmpp.Chat{ + _, err := xm.conn.Send(gxmpp.Chat{ Type: "groupchat", Remote: string(event.Room), Text: event.Text, }) - return nil + return err } else { return fmt.Errorf("Invalid event") } |