diff --git a/config.go b/config.go index 9a27d9e49d5b10181db7c21f0f3eab0a7b01e525..4e293306f2c075bf2805a79ab4deab20f1208a46 100644 --- a/config.go +++ b/config.go @@ -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 diff --git a/example-config.json b/example-config.json index f23cc18a145fc42d1a5d3ffdf3c01fe10f1fa56e..c68a2297ba7ec2b69120d4d61379897ab9bfeede 100644 --- a/example-config.json +++ b/example-config.json @@ -11,5 +11,8 @@ "homeserver": "https://matrix.org", "username": "", "password": "" + }, + "options": { + "irc-compatibility": false } } diff --git a/gitlab-webhook.go b/gitlab-webhook.go index f8393ca1fc708d1fcc0585f83a82f6e8b4f4dc00..bc23b030d820cf19b58c9bda23feebaf8831ef4e 100644 --- a/gitlab-webhook.go +++ b/gitlab-webhook.go @@ -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-- {