diff --git a/src/github.com/matrix-org/go-neb/services/travisci/travisci.go b/src/github.com/matrix-org/go-neb/services/travisci/travisci.go index 8185794..543b9d6 100644 --- a/src/github.com/matrix-org/go-neb/services/travisci/travisci.go +++ b/src/github.com/matrix-org/go-neb/services/travisci/travisci.go @@ -245,6 +245,7 @@ func (s *Service) Register(oldService types.Service, client *matrix.Client) erro } } } + s.joinRooms(client) return nil } @@ -266,6 +267,18 @@ func (s *Service) PostRegister(oldService types.Service) { } } +func (s *Service) joinRooms(client *matrix.Client) { + for roomID := range s.Rooms { + if _, err := client.JoinRoom(roomID, "", ""); err != nil { + log.WithFields(log.Fields{ + log.ErrorKey: err, + "room_id": roomID, + "user_id": client.UserID, + }).Error("Failed to join room") + } + } +} + func init() { types.RegisterService(func(serviceID, serviceUserID, webhookEndpointURL string) types.Service { return &Service{