浏览代码

Deal with unknown message types (#311)

If the app sends the message type `"unknown"`, render messages appropriately.
Danilo Bargen 8 年之前
父节点
当前提交
1b44975b9e
共有 4 个文件被更改,包括 7 次插入2 次删除
  1. 1 0
      public/i18n/de.json
  2. 1 0
      public/i18n/en.json
  3. 1 0
      src/directives/message_media.html
  4. 4 2
      src/threema.d.ts

+ 1 - 0
public/i18n/de.json

@@ -148,6 +148,7 @@
         "MESSAGE_TOO_LONG_SPLIT_SUBJECT": "Nachricht aufteilen.",
         "MESSAGE_TOO_LONG_SPLIT_BODY": "Es werden maximal {max} Zeichen pro Nachricht unterstützt, wollen Sie die Nachricht in {count} separate Nachrichten aufteilen?",
         "BALLOT_MESSAGES_NOT_SUPPORTED": "Umfragen werden in Threema Web derzeit nicht untersützt.",
+        "UNKNOWN_MESSAGE_TYPE": "Unbekannter Nachrichtentyp",
         "NICKNAME": "Nickname",
         "THREEMA_WORK_CONTACT": "Threema Work Nutzer"
     },

+ 1 - 0
public/i18n/en.json

@@ -149,6 +149,7 @@
         "MESSAGE_TOO_LONG_SPLIT_SUBJECT": "Split Message",
         "MESSAGE_TOO_LONG_SPLIT_BODY": "No more than {max} characters can be sent per message, do you want to split it into {count} separate messages?",
         "BALLOT_MESSAGES_NOT_SUPPORTED": "Ballot messages are not yet supported in Threema Web.",
+        "UNKNOWN_MESSAGE_TYPE": "Unknown message type",
         "NICKNAME": "Nickname",
         "THREEMA_WORK_CONTACT": "Threema Work user"
     },

+ 1 - 0
src/directives/message_media.html

@@ -91,3 +91,4 @@
 </div>
 <!-- Ballot -->
 <span ng-if="ctrl.type === 'ballot'"><em translate>messenger.BALLOT_MESSAGES_NOT_SUPPORTED</em></span> <!-- TODO -->
+<span ng-if="ctrl.type === 'unknown'"><em translate>messenger.UNKNOWN_MESSAGE_TYPE</em></span> <!-- TODO -->

+ 4 - 2
src/threema.d.ts

@@ -42,8 +42,10 @@ declare namespace threema {
         data?: any;
     }
 
-    type MessageType = 'text' | 'image' | 'video' | 'audio' | 'location' | 'status' | 'ballot' | 'file' | 'voipStatus';
-    type MessageState = 'delivered' | 'read' | 'send-failed' | 'sent' | 'user-ack' | 'user-dec' | 'pending' | 'sending';
+    type MessageType = 'text' | 'image' | 'video' | 'audio' | 'location' | 'contact' |
+                       'status' | 'ballot' | 'file' | 'voipStatus' | 'unknown';
+    type MessageState = 'delivered' | 'read' | 'send-failed' | 'sent' | 'user-ack' |
+                        'user-dec' | 'pending' | 'sending';
     type InitializationStep = 'client info' | 'conversations' | 'receivers';
 
     interface InitializationStepRoutine {