diff options
Diffstat (limited to 'bug/op_edit_comment.go')
-rw-r--r-- | bug/op_edit_comment.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/bug/op_edit_comment.go b/bug/op_edit_comment.go index c6cfab2b..cb4a2216 100644 --- a/bug/op_edit_comment.go +++ b/bug/op_edit_comment.go @@ -57,18 +57,20 @@ func (op *EditCommentOperation) Apply(snapshot *Snapshot) { return } + comment := Comment{ + Message: op.Message, + Files: op.Files, + UnixTime: Timestamp(op.UnixTime), + } + switch target.(type) { case *CreateTimelineItem: item := target.(*CreateTimelineItem) - newComment := item.LastState() - newComment.Message = op.Message - item.History = append(item.History, newComment) + item.Append(comment) case *CommentTimelineItem: item := target.(*CommentTimelineItem) - newComment := item.LastState() - newComment.Message = op.Message - item.History = append(item.History, newComment) + item.Append(comment) } snapshot.Comments[commentIndex].Message = op.Message |