fix: recover stale IM member credentials

This commit is contained in:
richjohnrambo
2026-10-14 18:18:18 +08:00
parent a6d7c8dda8
commit 06eaf748ed
3 changed files with 53 additions and 1 deletions
+8
View File
@@ -381,3 +381,11 @@ func IsConflict(err error) bool {
var target *Error
return errors.As(err, &target) && target.Status == http.StatusConflict
}
// IsAuthenticationFailed reports whether the IM server rejected user
// credentials. Callers may use this to repair credentials which have drifted
// from the local encrypted copy, while leaving transport failures untouched.
func IsAuthenticationFailed(err error) bool {
var target *Error
return errors.As(err, &target) && target.Status == http.StatusUnauthorized
}