diff options
author | Josh Bialkowski <josh.bialkowski@gmail.com> | 2019-11-07 08:01:08 -0800 |
---|---|---|
committer | Josh Bialkowski <josh.bialkowski@gmail.com> | 2019-12-18 07:42:13 -0800 |
commit | eff830bdcb8f979da34fb9e8f782efb1598b4a44 (patch) | |
tree | d0aa7524125b08c863e7ad7683272ab29cf99ad3 /cache/bug_cache.go | |
parent | e96d8e6771086e20639a16abf6af30f2faa006a0 (diff) | |
download | git-bug-eff830bdcb8f979da34fb9e8f782efb1598b4a44.tar.gz |
Implement jira bridge
Diffstat (limited to 'cache/bug_cache.go')
-rw-r--r-- | cache/bug_cache.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cache/bug_cache.go b/cache/bug_cache.go index 6026190f..965ebe94 100644 --- a/cache/bug_cache.go +++ b/cache/bug_cache.go @@ -210,6 +210,28 @@ func (c *BugCache) SetTitleRaw(author *IdentityCache, unixTime int64, title stri return op, c.notifyUpdated() } +func (c *BugCache) EditBody(body string) (*bug.EditCommentOperation, error) { + author, err := c.repoCache.GetUserIdentity() + if err != nil { + return nil, err + } + + return c.EditBodyRaw(author, time.Now().Unix(), body, nil) +} + +func (c *BugCache) EditBodyRaw(author *IdentityCache, unixTime int64, body string, metadata map[string]string) (*bug.EditCommentOperation, error) { + op, err := bug.EditBody(c.bug, author.Identity, unixTime, body) + if err != nil { + return nil, err + } + + for key, value := range metadata { + op.SetMetadata(key, value) + } + + return op, c.notifyUpdated() +} + func (c *BugCache) EditComment(target entity.Id, message string) (*bug.EditCommentOperation, error) { author, err := c.repoCache.GetUserIdentity() if err != nil { |