Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
greeeen-dev committed Oct 25, 2024
1 parent 8f1df25 commit 5db7020
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions cogs/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,11 @@ async def send(self, room: str, message,
else:
size_total += source_support.attachment_size(attachment)

size_limit = 25000000
if platform == 'discord':
size_limit = 25000000
else:
size_limit = dest_support.attachment_size_limit or 0

if size_limit > self.__bot.config['global_filesize_limit'] > 0:
size_limit = self.__bot.config['global_filesize_limit']

Expand Down Expand Up @@ -1827,7 +1831,12 @@ async def to_file(source_file):
for attachment in attachments:
if system:
break
size_limit = 25000000

if platform == 'discord':
size_limit = 25000000
else:
size_limit = dest_support.attachment_size_limit or 0

if size_limit > self.__bot.config['global_filesize_limit'] > 0:
size_limit = self.__bot.config['global_filesize_limit']

Expand All @@ -1847,7 +1856,7 @@ async def to_file(source_file):
if (
not 'audio' in content_type and not 'video' in content_type and not 'image' in content_type
and not 'text/plain' in content_type and self.__bot.config['safe_filetypes']
) or attachment_size > dest_support.attachment_size_limit or not is_allowed:
) or attachment_size > size_limit or not is_allowed:
continue

try:
Expand Down

0 comments on commit 5db7020

Please sign in to comment.