mirror of
https://github.com/matrix-org/pantalaimon.git
synced 2025-01-09 06:37:55 -05:00
Do not fail if msgtype is not defined
This commit is contained in:
parent
59051c530a
commit
bd7af084f7
@ -922,7 +922,7 @@ class ProxyDaemon:
|
|||||||
|
|
||||||
# The room isn't encrypted just forward the message.
|
# The room isn't encrypted just forward the message.
|
||||||
if not encrypt:
|
if not encrypt:
|
||||||
content_msgtype = content["msgtype"]
|
content_msgtype = content.get("msgtype")
|
||||||
if content_msgtype in ["m.image", "m.video", "m.audio", "m.file"] or msgtype == "m.room.avatar":
|
if content_msgtype in ["m.image", "m.video", "m.audio", "m.file"] or msgtype == "m.room.avatar":
|
||||||
try:
|
try:
|
||||||
content = await self._map_decrypted_uri("url", content, request, client)
|
content = await self._map_decrypted_uri("url", content, request, client)
|
||||||
@ -938,7 +938,7 @@ class ProxyDaemon:
|
|||||||
|
|
||||||
async def _send(ignore_unverified=False):
|
async def _send(ignore_unverified=False):
|
||||||
try:
|
try:
|
||||||
content_msgtype = content["msgtype"]
|
content_msgtype = content.get("msgtype")
|
||||||
if content_msgtype in ["m.image", "m.video", "m.audio", "m.file"] or msgtype == "m.room.avatar":
|
if content_msgtype in ["m.image", "m.video", "m.audio", "m.file"] or msgtype == "m.room.avatar":
|
||||||
upload_info, media_info = self._get_upload_and_media_info("url", content)
|
upload_info, media_info = self._get_upload_and_media_info("url", content)
|
||||||
if not upload_info or not media_info:
|
if not upload_info or not media_info:
|
||||||
|
Loading…
Reference in New Issue
Block a user