From 646a8637ff492f794d5ce2a0b7c4b0e88a8f3ce3 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 23 Jun 2020 22:28:28 +0300 Subject: Show decryption errors more accurately. Fixes #174 --- ui/messages/parser.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/messages/parser.go b/ui/messages/parser.go index 80bfa40..94c657b 100644 --- a/ui/messages/parser.go +++ b/ui/messages/parser.go @@ -81,8 +81,10 @@ func directParseEvent(matrix ifc.MatrixContainer, room *rooms.Room, evt *muksevt content.MsgType = event.MsgImage } return ParseMessage(matrix, room, evt, displayname) - case *event.EncryptedEventContent: - return NewExpandedTextMessage(evt, displayname, tstring.NewStyleTString("Decryption failed or gomuks not built with encryption support", tcell.StyleDefault.Italic(true))) + case *muksevt.BadEncryptedContent: + return NewExpandedTextMessage(evt, displayname, tstring.NewStyleTString(content.Reason, tcell.StyleDefault.Italic(true))) + case *muksevt.EncryptionUnsupportedContent: + return NewExpandedTextMessage(evt, displayname, tstring.NewStyleTString("gomuks not built with encryption support", tcell.StyleDefault.Italic(true))) case *event.TopicEventContent, *event.RoomNameEventContent, *event.CanonicalAliasEventContent: return ParseStateEvent(evt, displayname) case *event.MemberEventContent: -- cgit v1.2.3