From b7e502526baf5d254e7d1525339a4c61a7ae0edd Mon Sep 17 00:00:00 2001 From: Toni Spets Date: Sun, 25 Apr 2021 13:57:22 +0300 Subject: [PATCH 1/4] Support Heisenbridge short names --- matrix/buffer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/matrix/buffer.py b/matrix/buffer.py index 70049a9..d173dcb 100644 --- a/matrix/buffer.py +++ b/matrix/buffer.py @@ -1072,7 +1072,8 @@ class RoomBuffer(object): user.user_id.startswith("@facebook_") or user.user_id.startswith("@telegram_") or user.user_id.startswith("@_telegram_") or - user.user_id.startswith("@_xmpp_")): + user.user_id.startswith("@_xmpp_") or + user.user_id.startswith("@irc_")): if user.display_name: short_name = user.display_name[0:50] elif user.user_id.startswith("@twilio_"): From 0d491bd3a61d660e7c6addf492bed76361195679 Mon Sep 17 00:00:00 2001 From: Filip Stedronsky Date: Sat, 1 May 2021 15:59:47 +0200 Subject: [PATCH 2/4] Fix shortnames for Discord & Slack puppetting bridges --- matrix/buffer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/matrix/buffer.py b/matrix/buffer.py index d173dcb..7cc305e 100644 --- a/matrix/buffer.py +++ b/matrix/buffer.py @@ -1068,6 +1068,8 @@ class RoomBuffer(object): # freenode bridge users better if (user.user_id.startswith("@_discord_") or user.user_id.startswith("@_slack_") or + user.user_id.startswith("@_discordpuppet_") or + user.user_id.startswith("@_slackpuppet_") or user.user_id.startswith("@whatsapp_") or user.user_id.startswith("@facebook_") or user.user_id.startswith("@telegram_") or From 04be5a8764df750777fed065e0622298c9d7bc2f Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Tue, 25 May 2021 20:11:37 -0700 Subject: [PATCH 3/4] Support short names for OFTC bridge --- matrix/buffer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/matrix/buffer.py b/matrix/buffer.py index 7cc305e..8501ed5 100644 --- a/matrix/buffer.py +++ b/matrix/buffer.py @@ -1084,6 +1084,8 @@ class RoomBuffer(object): short_name = shorten_sender(user.user_id[9:]) elif user.user_id.startswith("@_ircnet_"): short_name = shorten_sender(user.user_id[8:]) + elif user.user_id.startswith("@_oftc_"): + short_name = shorten_sender(user.user_id[6:]) elif user.user_id.startswith("@gitter_"): short_name = shorten_sender(user.user_id[7:]) From a4efd87e50046d8de43debb3fcd5b0243fce88fd Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Wed, 2 Jun 2021 11:51:17 +0200 Subject: [PATCH 4/4] Use the full path when reading in EncryptedUpload Calling ``matrix_upload.py --encrypt`` with a filename outside of the current directory fails due to a typo in EncryptedUpload which uses the basename of the file instead of the original/full path. --- contrib/matrix_upload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/matrix_upload.py b/contrib/matrix_upload.py index 25b79f5..64633f9 100755 --- a/contrib/matrix_upload.py +++ b/contrib/matrix_upload.py @@ -113,7 +113,7 @@ class EncryptedUpload(Upload): self.source_mimetype = self.mimetype self.mimetype = "application/octet-stream" - with open(self.filename, "rb") as file: + with open(self.file, "rb") as file: self.ciphertext, self.file_keys = encrypt_attachment(file.read()) def send_progress(self):