ソースを参照

Fix only convert chat message ID to hex when connected to iOS

Lennart Grahl 6 年 前
コミット
dbd5558b7c
1 ファイル変更7 行追加2 行削除
  1. 7 2
      src/services/webclient.ts

+ 7 - 2
src/services/webclient.ts

@@ -4066,9 +4066,14 @@ export class WebClientService {
      */
     private logChatMessages(type: string, subType: string, messages: threema.Message[]) {
         for (const message of messages) {
-            const idHex = u8aToHex(base64ToU8a(message.id));
+            let id: string = message.id;
+            if (this.clientInfo.os === threema.OperatingSystem.Ios) {
+                try {
+                    id = u8aToHex(base64ToU8a(message.id));
+                } catch { /* ignored */ }
+            }
             this.$log.debug('[MessageInspector]', `${type}/${subType}: direction=${message.isOutbox ? 'out' : 'in'}, ` +
-                `id=${idHex}, type=${message.type}, state=${message.state !== undefined ? message.state : '?'}, ` +
+                `id=${id}, type=${message.type}, state=${message.state !== undefined ? message.state : '?'}, ` +
                 `is-status=${message.isStatus}, date=${message.date}`);
         }
     }