Update to latest go-gitter API changes

This commit is contained in:
Wim 2016-11-02 16:28:23 +01:00
parent 1b15897135
commit 581847f415
1 changed files with 8 additions and 4 deletions

View File

@ -51,15 +51,19 @@ func (b *Bgitter) FullOrigin() string {
} }
func (b *Bgitter) JoinChannel(channel string) error { func (b *Bgitter) JoinChannel(channel string) error {
_, err := b.c.JoinRoom(channel)
if err != nil {
return err
}
room := channel room := channel
roomID := b.getRoomID(room) roomID := b.getRoomID(room)
if roomID == "" { if roomID == "" {
return nil return nil
} }
user, err := b.c.GetUser()
if err != nil {
return err
}
_, err = b.c.JoinRoom(roomID, user.ID)
if err != nil {
return err
}
stream := b.c.Stream(roomID) stream := b.c.Stream(roomID)
go b.c.Listen(stream) go b.c.Listen(stream)