Skip to content
Snippets Groups Projects
Commit 3b319d5f authored by Tulir Asokan's avatar Tulir Asokan :cat2:
Browse files

Allow disabling IRC compatibility

parent 3792d24b
No related branches found
No related tags found
No related merge requests found
......@@ -39,6 +39,10 @@ type Config struct {
GitLab struct {
Domain string `json:"domain"`
} `json:"gitlab"`
Options struct {
IRCCompatibility bool `json:"irc-compatibility"`
} `json:"options"`
}
var config Config
......
......@@ -11,5 +11,8 @@
"homeserver": "https://matrix.org",
"username": "",
"password": ""
},
"options": {
"irc-compatibility": false
}
}
......@@ -96,7 +96,7 @@ func handlePushEvent(payload interface{}, header webhooks.Header) {
pluralizer)
// IRC compatibility: Allow up to 4 commits to be displayed through the IRC bridge without
// having the bridge turn the message into a link.
if data.TotalCommitsCount > 4 {
if data.TotalCommitsCount > 4 || !config.Options.IRCCompatibility {
var msg bytes.Buffer
fmt.Fprintln(&msg, "<ul>")
for i := len(data.Commits) - 1; i >= 0; i-- {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment