fix images in modmail

pull/104/head
Aevann 2023-01-28 10:47:52 +02:00
parent a2d8bcf6ab
commit cd573133a9
3 changed files with 15 additions and 7 deletions

View File

@ -267,6 +267,8 @@ def process_dm_images(v, user):
if body:
with open(f"{LOG_DIRECTORY}/dm_images.log", "a+", encoding="utf-8") as f:
if user:
f.write(f'{body.strip()}, {v.username}, {v.id}, {user.username}, {user.id}\n')
else:
f.write(f'{body.strip()}, {v.username}, {v.id}, Modmail, Modmail\n')
return body

View File

@ -557,6 +557,8 @@ def messagereply(v:User):
if parent.sentto == MODMAIL_ID: user_id = None
elif v.id == user_id: user_id = parent.sentto
user = None
if user_id:
user = get_account(user_id, v=v, include_blocks=True)
if hasattr(user, 'is_blocking') and user.is_blocking:

View File

@ -31,11 +31,15 @@
</td>
<td>
{% if item[1] != "Unknown" %}
{% if item[3] == "Modmail" %}
Modmail
{% else %}
<a href="/id/{{item[4]}}">
<img loading="lazy" src="/pp/{{item[4]}}">
@{{item[3]}}
</a>
{% endif %}
{% endif %}
</td>
</tr>
{% endfor %}