Browse Source

Add JIRA starter links

pull/28/head
Kegan Dougal 8 years ago
parent
commit
4ea8e6d49d
  1. 1
      src/github.com/matrix-org/go-neb/realms/jira/jira.go
  2. 9
      src/github.com/matrix-org/go-neb/services/jira/jira.go

1
src/github.com/matrix-org/go-neb/realms/jira/jira.go

@ -33,6 +33,7 @@ type JIRARealm struct {
PublicKeyPEM string // clobbered based on PrivateKeyPEM
PrivateKeyPEM string
HasWebhook bool // clobbered based on NEB
StarterLink string
}
// JIRASession represents a single authentication session between a user and a JIRA endpoint.

9
src/github.com/matrix-org/go-neb/services/jira/jira.go

@ -118,8 +118,13 @@ func (s *jiraService) cmdJiraCreate(roomID, userID string, args []string) (inter
cli, err := r.JIRAClient(userID, false)
if err != nil {
if err == sql.ErrNoRows { // no client found
return &matrix.TextMessage{"m.notice",
userID + " : You have not linked your JIRA account."}, nil
return matrix.StarterLinkMessage{
Body: fmt.Sprintf(
"You need to OAuth with JIRA on %s before you can create issues.",
r.JIRAEndpoint,
),
Link: r.StarterLink,
}, nil
}
return nil, err
}

Loading…
Cancel
Save