Notifications fix - Discord - added discord webhook base url to truncation rules (#753)

Co-authored-by: bwees <branonwees@gmail.com>
pull/764/head
Brandon Wees 2022-07-14 11:41:12 -04:00 zatwierdzone przez GitHub
rodzic ebb8b88621
commit ace44d0e00
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -79,7 +79,7 @@ def process_notification(n_object, datastore):
n_title = n_title[0:payload_max_size]
n_body = n_body[0:body_limit]
elif url.startswith('discord://'):
elif url.startswith('discord://') or url.startswith('https://discordapp.com/api/webhooks'):
# real limit is 2000, but minus some for extra metadata
payload_max_size = 1700
body_limit = max(0, payload_max_size - len(n_title))