pub async fn try_decrypt_message<W: WalletInterface>(
wallet: &W,
raw_body: &str,
sender_pubkey_hex: &str,
originator: Option<&str>,
) -> StringExpand description
Try to decrypt a message body, with graceful fallback for plaintext.
Handles three cases (matching TS listMessagesLite lines 1442-1452):
- JSON with a
"message"wrapper key: unwrap first, then check inner content. - JSON with
"encryptedMessage"key: decrypt. - Anything else (no encryptedMessage key, or not JSON): return original body unchanged.
Does NOT panic on parse failure — always returns a String.
NOTE: PARITY — passes originator: None inside when called from list_messages_lite.
This matches a latent TS bug where listMessagesLite omits originator.