From 46351d0d477df122b12f3556590dc87753c1307d Mon Sep 17 00:00:00 2001 From: vocoder Date: Mon, 11 Nov 2024 14:55:33 -0500 Subject: [PATCH] Matrix: Allow token only for V2 API with ?token. --- apprise/plugins/matrix.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apprise/plugins/matrix.py b/apprise/plugins/matrix.py index 3dde574e..cd8c14e9 100644 --- a/apprise/plugins/matrix.py +++ b/apprise/plugins/matrix.py @@ -103,11 +103,15 @@ class MatrixVersion: # Version 3 V3 = "3" + # Token + TOKEN = "token" + # webhook modes are placed into this list for validation purposes MATRIX_VERSIONS = ( MatrixVersion.V2, MatrixVersion.V3, + MatrixVersion.TOKEN ) @@ -1474,6 +1478,9 @@ class NotifyMatrix(NotifyBase): auth = '' if self.mode != MatrixWebhookMode.T2BOT: + if self.version == "token": + self.access_token = self.user + # Determine Authentication if self.user and self.password: auth = '{user}:{password}@'.format( @@ -1574,6 +1581,8 @@ class NotifyMatrix(NotifyBase): elif 'v' in results['qsd'] and len(results['qsd']['v']): results['version'] = NotifyMatrix.unquote(results['qsd']['v']) + if results['version'] == "token": + results['mode'] = MatrixWebhookMode.DISABLED return results