Skip to content

Commit 9568341

Browse files
committed
Merge remote-tracking branch 'origin/trust-fix'
2 parents 0fa2fe5 + 1c3e004 commit 9568341

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

android/tinySSB/app/src/main/java/nz/scuttlebutt/tremolavossbol/WebAppInterface.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -624,15 +624,15 @@ class WebAppInterface(val act: MainActivity, val webView: WebView) {
624624
//decode the entry using Bipf decode
625625
val decodedEntry = entry?.let { Bipf.decode(it) }
626626

627-
//get bytes from the decoded entry
628-
val entryBytes = decodedEntry?.let {it.getBytes()}
627+
if (decodedEntry != null && decodedEntry.typ == BIPF_BYTES) {
628+
//get bytes from the decoded entry
629+
val entryBytes = decodedEntry.getBytes()
629630

630-
//decrypt the bytes to get the clear text
631-
val clear = entryBytes?.let { act.idStore.identity.decryptPrivateMessage(it) }
631+
//decrypt the bytes to get the clear text
632+
val clear = entryBytes.let { act.idStore.identity.decryptPrivateMessage(it) }
632633

633-
val entryType = clear?.let { getFromEntry(it, 0) }
634-
if (entryType == "DEL") {
635-
if (clear is ByteArray) {
634+
val entryType = clear?.let { getFromEntry(it, 0) }
635+
if (entryType == "DEL") {
636636
val contactID = getFromEntry(clear, 1)
637637
val deleted = getFromEntry(clear, 2)
638638
Log.d("readContactDeleted", "Contact ID: $contactID, Deleted: $deleted")

0 commit comments

Comments
 (0)