this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

cleanup types

dholms bf8d6583 58617b82

+25 -23
+13 -13
nexus/models/models.go
··· 13 13 RepoStateError RepoState = "error" 14 14 ) 15 15 16 - type RepoStatus string 16 + type AccountStatus string 17 17 18 18 const ( 19 - RepoStatusActive RepoStatus = "active" 20 - RepoStatusTakendown RepoStatus = "takendown" 21 - RepoStatusSuspended RepoStatus = "suspended" 22 - RepoStatusDeactivated RepoStatus = "deactivated" 23 - RepoStatusDeleted RepoStatus = "deleted" 19 + AccountStatusActive AccountStatus = "active" 20 + AccountStatusTakendown AccountStatus = "takendown" 21 + AccountStatusSuspended AccountStatus = "suspended" 22 + AccountStatusDeactivated AccountStatus = "deactivated" 23 + AccountStatusDeleted AccountStatus = "deleted" 24 24 ) 25 25 26 26 type Repo struct { 27 - Did string `gorm:"primaryKey"` 28 - State RepoState `gorm:"not null;default:'pending';index"` 29 - Status RepoStatus `gorm:"not null;default:'active'"` 30 - Handle string `gorm:"type:text"` 31 - Rev string `gorm:"type:text"` 32 - PrevData string `gorm:"type:text"` 33 - ErrorMsg string `gorm:"type:text"` 27 + Did string `gorm:"primaryKey"` 28 + State RepoState `gorm:"not null;default:'pending';index"` 29 + Status AccountStatus `gorm:"not null;default:'active'"` 30 + Handle string `gorm:"type:text"` 31 + Rev string `gorm:"type:text"` 32 + PrevData string `gorm:"type:text"` 33 + ErrorMsg string `gorm:"type:text"` 34 34 } 35 35 36 36 type OutboxBuffer struct {
+6 -6
nexus/processor.go
··· 243 243 244 244 // handle delete first 245 245 246 - var updateTo models.RepoStatus 246 + var updateTo models.AccountStatus 247 247 if evt.Active { 248 - updateTo = models.RepoStatusActive 249 - } else if *evt.Status == string(models.RepoStatusDeactivated) || *evt.Status == string(models.RepoStatusTakendown) || *evt.Status == string(models.RepoStatusSuspended) { 250 - updateTo = models.RepoStatus(*evt.Status) 248 + updateTo = models.AccountStatusActive 249 + } else if *evt.Status == string(models.AccountStatusDeactivated) || *evt.Status == string(models.AccountStatusTakendown) || *evt.Status == string(models.AccountStatusSuspended) { 250 + updateTo = models.AccountStatus(*evt.Status) 251 251 } else { 252 252 // NOOP 253 253 return nil ··· 261 261 Where("did = ?", evt.Did). 262 262 Update("status", updateTo).Error 263 263 if err != nil { 264 - ep.Logger.Error("failed to update repo status", "did", evt.Did, "status", models.RepoStatusActive, "error", err) 264 + ep.Logger.Error("failed to update repo status", "did", evt.Did, "status", models.AccountStatusActive, "error", err) 265 265 return err 266 266 } 267 267 ··· 269 269 Did: curr.Did, 270 270 Handle: curr.Handle, 271 271 IsActive: evt.Active, 272 - Status: string(updateTo), 272 + Status: updateTo, 273 273 }) 274 274 275 275 if err != nil {
+6 -4
nexus/types.go
··· 1 1 package main 2 2 3 + import "github.com/bluesky-social/indigo/nexus/models" 4 + 3 5 type Commit struct { 4 6 Did string `json:"did"` 5 7 Rev string `json:"rev"` ··· 42 44 } 43 45 44 46 type UserEvt struct { 45 - Did string `json:"did"` 46 - Handle string `json:"handle"` 47 - IsActive bool `json:"is_active"` 48 - Status string `json:"status"` 47 + Did string `json:"did"` 48 + Handle string `json:"handle"` 49 + IsActive bool `json:"is_active"` 50 + Status models.AccountStatus `json:"status"` 49 51 } 50 52 51 53 type OutboxEvt struct {