fix(xep): Fix handling StanzaErrors from the DiscoManager

This commit is contained in:
PapaTutuWawa 2023-07-01 13:19:26 +02:00
parent a928c5c877
commit b92e825bc1

View File

@ -5,8 +5,8 @@ import 'package:moxxmpp/src/jid.dart';
import 'package:moxxmpp/src/managers/base.dart'; import 'package:moxxmpp/src/managers/base.dart';
import 'package:moxxmpp/src/managers/namespaces.dart'; import 'package:moxxmpp/src/managers/namespaces.dart';
import 'package:moxxmpp/src/namespaces.dart'; import 'package:moxxmpp/src/namespaces.dart';
import 'package:moxxmpp/src/stanza.dart';
import 'package:moxxmpp/src/stringxml.dart'; import 'package:moxxmpp/src/stringxml.dart';
import 'package:moxxmpp/src/xeps/xep_0030/errors.dart';
import 'package:moxxmpp/src/xeps/xep_0030/types.dart'; import 'package:moxxmpp/src/xeps/xep_0030/types.dart';
import 'package:moxxmpp/src/xeps/xep_0030/xep_0030.dart'; import 'package:moxxmpp/src/xeps/xep_0030/xep_0030.dart';
import 'package:moxxmpp/src/xeps/xep_0060/errors.dart'; import 'package:moxxmpp/src/xeps/xep_0060/errors.dart';
@ -226,7 +226,7 @@ class UserAvatarManager extends XmppManagerBase {
jid, jid,
node: userAvatarDataXmlns, node: userAvatarDataXmlns,
); );
if (response.isType<DiscoError>()) return Result(UnknownAvatarError()); if (response.isType<StanzaError>()) return Result(UnknownAvatarError());
final items = response.get<List<DiscoItem>>(); final items = response.get<List<DiscoItem>>();
if (items.isEmpty) return Result(UnknownAvatarError()); if (items.isEmpty) return Result(UnknownAvatarError());