aboutsummaryrefslogtreecommitdiffstats
path: root/bug/operations/add_comment.go
diff options
context:
space:
mode:
Diffstat (limited to 'bug/operations/add_comment.go')
-rw-r--r--bug/operations/add_comment.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/bug/operations/add_comment.go b/bug/operations/add_comment.go
index 2b83de83..1f9e3410 100644
--- a/bug/operations/add_comment.go
+++ b/bug/operations/add_comment.go
@@ -1,13 +1,17 @@
package operations
-import "github.com/MichaelMure/git-bug/bug"
+import (
+ "github.com/MichaelMure/git-bug/bug"
+ "time"
+)
var _ bug.Operation = AddCommentOperation{}
type AddCommentOperation struct {
bug.OpBase
- Message string `json:"m"`
- Author bug.Person `json:"a"`
+ Message string
+ Author bug.Person
+ Time time.Time
}
func NewAddCommentOp(author bug.Person, message string) AddCommentOperation {
@@ -15,6 +19,7 @@ func NewAddCommentOp(author bug.Person, message string) AddCommentOperation {
OpBase: bug.OpBase{OperationType: bug.ADD_COMMENT},
Message: message,
Author: author,
+ Time: time.Now(),
}
}
@@ -22,6 +27,7 @@ func (op AddCommentOperation) Apply(snapshot bug.Snapshot) bug.Snapshot {
comment := bug.Comment{
Message: op.Message,
Author: op.Author,
+ Time: op.Time,
}
snapshot.Comments = append(snapshot.Comments, comment)