This commit is contained in:
Bohdan Horbeshko 2021-06-06 05:10:24 +03:00
commit 6081b7eded
2 changed files with 7 additions and 2 deletions

View file

@ -113,7 +113,7 @@ class EncryptedUpload(Upload):
self.source_mimetype = self.mimetype self.source_mimetype = self.mimetype
self.mimetype = "application/octet-stream" 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()) self.ciphertext, self.file_keys = encrypt_attachment(file.read())
def send_progress(self): def send_progress(self):

View file

@ -1068,11 +1068,14 @@ class RoomBuffer(object):
# freenode bridge users better # freenode bridge users better
if (user.user_id.startswith("@_discord_") or if (user.user_id.startswith("@_discord_") or
user.user_id.startswith("@_slack_") 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("@whatsapp_") or
user.user_id.startswith("@facebook_") or user.user_id.startswith("@facebook_") or
user.user_id.startswith("@telegram_") or user.user_id.startswith("@telegram_") 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: if user.display_name:
short_name = user.display_name[0:50] short_name = user.display_name[0:50]
elif user.user_id.startswith("@twilio_"): elif user.user_id.startswith("@twilio_"):
@ -1081,6 +1084,8 @@ class RoomBuffer(object):
short_name = shorten_sender(user.user_id[9:]) short_name = shorten_sender(user.user_id[9:])
elif user.user_id.startswith("@_ircnet_"): elif user.user_id.startswith("@_ircnet_"):
short_name = shorten_sender(user.user_id[8:]) 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_"): elif user.user_id.startswith("@gitter_"):
short_name = shorten_sender(user.user_id[7:]) short_name = shorten_sender(user.user_id[7:])