浏览代码

call notifications: add call type to offer messages

Sumner Evans 3 年之前
父节点
当前提交
0da2405177
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      mautrix_signal/signal.py

+ 7 - 1
mautrix_signal/signal.py

@@ -169,7 +169,13 @@ class SignalHandler(SignaldClient):
 
         msg_html = f'<a href="https://matrix.to/#/{sender.mxid}">{sender.name}</a>'
         if msg.call_message.offer_message:
-            msg_html += " started a call on Signal. Use the native app to answer the call."
+            call_type = {
+                OfferMessageType.AUDIO_CALL: " voice ",
+                OfferMessageType.VIDEO_CALL: " video ",
+            }.get(msg.call_message.offer_message.type, " ")
+            msg_html += (
+                f" started a{call_type}call on Signal. Use the native app to answer the call."
+            )
         elif msg.call_message.hangup_message:
             msg_html += " ended a call on Signal."
         else: