From 5016fef3c1187a6d5057b4f06305b7fbf2d56a94 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Fri, 11 Dec 2020 12:11:02 +0100 Subject: [PATCH 1/2] refs #4719 all bridge services have a channel key Signed-off-by: Julien Veyssier --- lib/MatterbridgeManager.php | 1 + .../RightSidebar/Matterbridge/MatterbridgeSettings.vue | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/MatterbridgeManager.php b/lib/MatterbridgeManager.php index 9c188c78399..2436727a5c1 100644 --- a/lib/MatterbridgeManager.php +++ b/lib/MatterbridgeManager.php @@ -494,6 +494,7 @@ private function generateConfig(array $bridge): string { } elseif ($type === 'steam') { $content .= sprintf(' chatid = "%s"', $part['chatid']) . "\n\n"; } + $content .= "\n"; } return $content; diff --git a/src/components/RightSidebar/Matterbridge/MatterbridgeSettings.vue b/src/components/RightSidebar/Matterbridge/MatterbridgeSettings.vue index adb74b56b69..fb6ba91d202 100644 --- a/src/components/RightSidebar/Matterbridge/MatterbridgeSettings.vue +++ b/src/components/RightSidebar/Matterbridge/MatterbridgeSettings.vue @@ -320,7 +320,7 @@ export default { placeholder: t('spreed', 'Password'), icon: 'icon-category-auth', }, - chatid: { + channel: { type: 'text', placeholder: t('spreed', 'Chat ID'), icon: 'icon-group', @@ -394,7 +394,7 @@ export default { placeholder: t('spreed', 'Team ID'), icon: 'icon-category-auth', }, - threadid: { + channel: { type: 'text', placeholder: t('spreed', 'Thread ID'), icon: 'icon-group', From c836088bbf0383e944486baa20f06e2090e7cad7 Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Fri, 18 Dec 2020 11:10:02 +0100 Subject: [PATCH 2/2] fix backport conflict, always use channel key in gateway sections Signed-off-by: Julien Veyssier --- lib/MatterbridgeManager.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/MatterbridgeManager.php b/lib/MatterbridgeManager.php index 2436727a5c1..6233416102e 100644 --- a/lib/MatterbridgeManager.php +++ b/lib/MatterbridgeManager.php @@ -481,18 +481,9 @@ private function generateConfig(array $bridge): string { $content .= '[[gateway.inout]]' . "\n"; $content .= sprintf(' account = "%s.%s"', $type, $k) . "\n"; - if (in_array($type, ['zulip', 'discord', 'xmpp', 'irc', 'slack', 'rocketchat', 'mattermost', 'matrix', 'nctalk'])) { - $content .= sprintf(' channel = "%s"', $part['channel']) . "\n"; - if ($type === 'irc' && $part['password']) { - $content .= sprintf(' options = { key = "%s" }', $part['password']) . "\n"; - } - $content .= "\n"; - } elseif ($type === 'msteams') { - $content .= sprintf(' threadId = "%s"', $part['threadid']) . "\n\n"; - } elseif ($type === 'telegram') { - $content .= sprintf(' channel = "%s"', $part['channel']) . "\n\n"; - } elseif ($type === 'steam') { - $content .= sprintf(' chatid = "%s"', $part['chatid']) . "\n\n"; + $content .= sprintf(' channel = "%s"', $part['channel']) . "\n"; + if ($type === 'irc' && $part['password']) { + $content .= sprintf(' options = { key = "%s" }', $part['password']) . "\n"; } $content .= "\n"; }