aboutsummaryrefslogtreecommitdiffstats
path: root/bug/snapshot.go
diff options
context:
space:
mode:
Diffstat (limited to 'bug/snapshot.go')
-rw-r--r--bug/snapshot.go36
1 files changed, 30 insertions, 6 deletions
diff --git a/bug/snapshot.go b/bug/snapshot.go
index 83b94416..53f6873a 100644
--- a/bug/snapshot.go
+++ b/bug/snapshot.go
@@ -12,12 +12,14 @@ import (
type Snapshot struct {
id string
- Status Status
- Title string
- Comments []Comment
- Labels []Label
- Author identity.Interface
- CreatedAt time.Time
+ Status Status
+ Title string
+ Comments []Comment
+ Labels []Label
+ Author identity.Interface
+ Actors []identity.Interface
+ Participants []identity.Interface
+ CreatedAt time.Time
Timeline []TimelineItem
@@ -62,3 +64,25 @@ func (snap *Snapshot) SearchTimelineItem(hash git.Hash) (TimelineItem, error) {
return nil, fmt.Errorf("timeline item not found")
}
+
+// append the operation author to the actors list
+func (snap *Snapshot) addActor(actor identity.Interface) {
+ for _, a := range snap.Actors {
+ if actor.Id() == a.Id() {
+ return
+ }
+ }
+
+ snap.Actors = append(snap.Actors, actor)
+}
+
+// append the operation author to the participants list
+func (snap *Snapshot) addParticipant(participant identity.Interface) {
+ for _, p := range snap.Participants {
+ if participant.Id() == p.Id() {
+ return
+ }
+ }
+
+ snap.Participants = append(snap.Participants, participant)
+}