summaryrefslogtreecommitdiffstats
path: root/modules/references/references.go
diff options
context:
space:
mode:
authorguillep2k <18600385+guillep2k@users.noreply.github.com>2019-11-18 10:13:07 -0300
committerLauris BH <lauris@nix.lv>2019-11-18 15:13:07 +0200
commitb15f26b1cf3dc976ae400d4a3c73ec3bd4a50bc6 (patch)
tree14e4b0e743605f25da792c96c6deb2d5e8200155 /modules/references/references.go
parent08ae6bb7edb9582c38edb8a0dba1b1be10fb00fc (diff)
downloadgitea-b15f26b1cf3dc976ae400d4a3c73ec3bd4a50bc6.tar.gz
gitea-b15f26b1cf3dc976ae400d4a3c73ec3bd4a50bc6.zip
Close/reopen issues by keywords in titles and comments (#8866)
* Add close/reopen from comment functionality * Fix comment * Rewrite closing/reopening template * Check xref permissions, move action to services/pull * Fix RefIsPull field * Add xref tests * Fix xref unique filter * Only highlight keywords for actionable xrefs * Fix xref neuter filter * Fix check return status * Restart CI
Diffstat (limited to 'modules/references/references.go')
-rw-r--r--modules/references/references.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/references/references.go b/modules/references/references.go
index af0fe1aa0d..17e9ec2c91 100644
--- a/modules/references/references.go
+++ b/modules/references/references.go
@@ -350,3 +350,8 @@ func findActionKeywords(content []byte, start int) (XRefAction, *RefSpan) {
}
return XRefActionNone, nil
}
+
+// IsXrefActionable returns true if the xref action is actionable (i.e. produces a result when resolved)
+func IsXrefActionable(a XRefAction) bool {
+ return a == XRefActionCloses || a == XRefActionReopens
+}