Fix / show source was showing content

This commit is contained in:
Valere 2019-07-01 10:47:10 +02:00
parent a734c699ad
commit e78b703387

View file

@ -174,9 +174,9 @@ class MessageMenuViewModel @AssistedInject constructor(@Assisted initialState: M
//TODO sent by me or sufficient power level //TODO sent by me or sufficient power level
} }
this.add(SimpleAction(VIEW_SOURCE, R.string.view_source, R.drawable.ic_view_source, JSONObject(event.root.content.toContent()).toString(4))) this.add(SimpleAction(VIEW_SOURCE, R.string.view_source, R.drawable.ic_view_source, JSONObject(event.root.toContent()).toString(4)))
if (event.isEncrypted()) { if (event.isEncrypted()) {
val decryptedContent = event.root.mClearEvent?.content?.toContent().let { val decryptedContent = event.root.mClearEvent.toContent()?.let {
JSONObject(it).toString(4) JSONObject(it).toString(4)
} ?: stringProvider.getString(R.string.encryption_information_decryption_error) } ?: stringProvider.getString(R.string.encryption_information_decryption_error)
this.add(SimpleAction(VIEW_DECRYPTED_SOURCE, R.string.view_decrypted_source, R.drawable.ic_view_source, decryptedContent)) this.add(SimpleAction(VIEW_DECRYPTED_SOURCE, R.string.view_decrypted_source, R.drawable.ic_view_source, decryptedContent))