mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
Add better message for group session withheld
This commit is contained in:
parent
4291333836
commit
96df4ac112
3 changed files with 4 additions and 0 deletions
|
|
@ -32,6 +32,7 @@ import (
|
|||
var _ crypto.StateStore = (*sqlstatestore.SQLStateStore)(nil)
|
||||
|
||||
var NoSessionFound = crypto.NoSessionFound
|
||||
var ErrGroupSessionWithheld = crypto.ErrGroupSessionWithheld
|
||||
var UnknownMessageIndex = olm.UnknownMessageIndex
|
||||
|
||||
type CryptoHelper struct {
|
||||
|
|
|
|||
|
|
@ -391,6 +391,8 @@ func errorToHumanMessage(err error) string {
|
|||
return err.Error()
|
||||
case errors.Is(err, UnknownMessageIndex):
|
||||
return "the keys received by the bridge can't decrypt the message"
|
||||
case errors.Is(err, ErrGroupSessionWithheld):
|
||||
return "your client refused to share decryption keys with the bridge"
|
||||
case errors.Is(err, errMessageNotEncrypted):
|
||||
return "the message is not encrypted"
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -22,4 +22,5 @@ func NewCryptoHelper(bridge *Bridge) Crypto {
|
|||
}
|
||||
|
||||
var NoSessionFound = errors.New("nil")
|
||||
var ErrGroupSessionWithheld = NoSessionFound
|
||||
var UnknownMessageIndex = NoSessionFound
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue