aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2020-06-23 22:28:28 +0300
committerTulir Asokan <tulir@maunium.net>2020-06-23 22:28:28 +0300
commit646a8637ff492f794d5ce2a0b7c4b0e88a8f3ce3 (patch)
tree32a939e5dae00cf6a3598bc60fe762670e40e1d7 /ui
parent376a2e5d84fb873fde40339feb4c1a9da150d5ff (diff)
Show decryption errors more accurately. Fixes #174
Diffstat (limited to 'ui')
-rw-r--r--ui/messages/parser.go6
1 files changed, 4 insertions, 2 deletions
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: