From 8c568c473dc9d2e965ccde6569c00153777efd14 Mon Sep 17 00:00:00 2001 From: Austin Su Date: Sat, 5 Mar 2022 18:29:07 +0800 Subject: [PATCH] Support RockChat 4.x up according to field object form https://developer.rocket.chat/reference/api/rest-api/endpoints/team-collaboration-endpoints/chat-endpoints/postmessage#attachment-field-objects . fill information properly. --- gitea-rocketchat.hooks.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gitea-rocketchat.hooks.js b/gitea-rocketchat.hooks.js index 125a678..bf47b2a 100644 --- a/gitea-rocketchat.hooks.js +++ b/gitea-rocketchat.hooks.js @@ -100,9 +100,10 @@ const giteaEvents = { for (var i = 0; i < commits.length; i++) { var commit = commits[i]; var shortID = commit.id.substring(0, 7); - output = '[#' + shortID + '](' + commit.url + '): \n' + commit.message attachment.fields.push({ - value: output, + short: false, + title: '[#' + shortID + '](' + commit.url + '): \n', + value: commit.message, }); }