Skip to content

Commit b9d49be

Browse files
committed
Add Plus / Plus Plus labels to Linear issues
1 parent 2b3c9fa commit b9d49be

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

linear.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ const (
5454
labelInternalUser = "f72b7249-393f-46a2-9e44-62f0300aed2e"
5555
labelNightlyUser = "74d1438d-eb93-4352-8efe-c6f3b291874f" // external-alpha-tester
5656
labelBooperApp = "67871d86-ef4b-45bc-9144-0368e70ec9bb" // booper-app
57+
labelPlusUser = "a2d1001f-c70b-4c42-b19c-82c6587674cc"
58+
labelPlusPlusUser = "0687d85b-a008-42a8-8462-bfd7c16b71e3"
5759
)
5860

5961
var appToTeamID = map[string]string{

rageshake

14 MB
Binary file not shown.

submit.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ type matrixWhoamiResponse struct {
265265
SupportRoomID string `json:"supportRoomId"`
266266
Email string `json:"email"`
267267
CreatedAt time.Time `json:"createdAt"`
268+
Subscription struct {
269+
PlanID string `json:"planId"`
270+
} `json:"subscription"`
268271
}
269272
User struct {
270273
Bridges map[string]whoamiBridgeInfo `json:"bridges"`
@@ -782,8 +785,16 @@ func (s *submitServer) submitLinearIssue(ctx context.Context, p parsedPayload, l
782785
labelIDs = append(labelIDs, labelInternalUser)
783786
} else {
784787
labelIDs = append(labelIDs, labelSupportReview)
785-
if p.MatrixWhoami != nil && p.MatrixWhoami.UserInfo.Channel == "NIGHTLY" {
786-
labelIDs = append(labelIDs, labelNightlyUser)
788+
if p.MatrixWhoami != nil {
789+
if p.MatrixWhoami.UserInfo.Channel == "NIGHTLY" {
790+
labelIDs = append(labelIDs, labelNightlyUser)
791+
}
792+
switch p.MatrixWhoami.UserInfo.Subscription.PlanID {
793+
case "PLUS":
794+
labelIDs = append(labelIDs, labelPlusUser)
795+
case "PLUS_PLUS":
796+
labelIDs = append(labelIDs, labelPlusPlusUser)
797+
}
787798
}
788799
}
789800
if p.MatrixWhoami != nil {

0 commit comments

Comments
 (0)