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 47c661b..5f2392d 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 @@ -50,8 +50,9 @@ var httpClient = &http.Client{} // } type Service struct { types.DefaultService + webhookEndpointURL string // The URL which should be added to .travis.yml - Populated by Go-NEB after Service registration. - WebhookEndpointURL string `json:"webhook_url"` + WebhookURL string `json:"webhook_url"` // A map from Matrix room ID to Github-style owner/repo repositories. Rooms map[string]struct { // A map of "owner/repo" to configuration information @@ -237,6 +238,7 @@ func (s *Service) OnReceiveWebhook(w http.ResponseWriter, req *http.Request, cli // Register makes sure the Config information supplied is valid. func (s *Service) Register(oldService types.Service, client *matrix.Client) error { + s.WebhookURL = s.webhookEndpointURL for _, roomData := range s.Rooms { for repo := range roomData.Repos { match := ownerRepoRegex.FindStringSubmatch(repo) @@ -283,7 +285,7 @@ func init() { types.RegisterService(func(serviceID, serviceUserID, webhookEndpointURL string) types.Service { return &Service{ DefaultService: types.NewDefaultService(serviceID, serviceUserID, ServiceType), - WebhookEndpointURL: webhookEndpointURL, + webhookEndpointURL: webhookEndpointURL, } }) }