diff --git a/packages/moxxmpp/CHANGELOG.md b/packages/moxxmpp/CHANGELOG.md index d2cf385..ac9937c 100644 --- a/packages/moxxmpp/CHANGELOG.md +++ b/packages/moxxmpp/CHANGELOG.md @@ -5,6 +5,7 @@ - **BREAKING**: Removed support for XEP-0414, as the (supported) hash computations are already implemented by `CryptographicHashManager.hashFromData`. - The `DiscoManager` now only handled entity capabilities if a `EntityCapabilityManager` is registered. - The `EntityCapabilityManager` now verifies and validates its data before caching. +- **BREAKING**: Added the `resumed` parameter to `StreamNegotiationsDoneEvent`. Use this to check if the current stream is new or resumed instead of using the `ConnectionStateChangedEvent`. ## 0.3.1 diff --git a/packages/moxxmpp/lib/src/connection.dart b/packages/moxxmpp/lib/src/connection.dart index 3d0435b..d880a54 100644 --- a/packages/moxxmpp/lib/src/connection.dart +++ b/packages/moxxmpp/lib/src/connection.dart @@ -15,7 +15,6 @@ import 'package:moxxmpp/src/managers/base.dart'; import 'package:moxxmpp/src/managers/data.dart'; import 'package:moxxmpp/src/managers/handlers.dart'; import 'package:moxxmpp/src/managers/namespaces.dart'; -import 'package:moxxmpp/src/negotiators/namespaces.dart'; import 'package:moxxmpp/src/negotiators/negotiator.dart'; import 'package:moxxmpp/src/parser.dart'; import 'package:moxxmpp/src/presence.dart'; @@ -28,7 +27,6 @@ import 'package:moxxmpp/src/stanza.dart'; import 'package:moxxmpp/src/stringxml.dart'; import 'package:moxxmpp/src/types/result.dart'; import 'package:moxxmpp/src/xeps/xep_0030/xep_0030.dart'; -import 'package:moxxmpp/src/xeps/xep_0198/negotiator.dart'; import 'package:moxxmpp/src/xeps/xep_0198/xep_0198.dart'; import 'package:moxxmpp/src/xeps/xep_0352.dart'; import 'package:synchronized/synchronized.dart'; @@ -611,15 +609,10 @@ class XmppConnection { _destroyConnectingTimer(); } - final sm = - _negotiationsHandler.getNegotiatorById( - streamManagementNegotiator, - ); await _sendEvent( ConnectionStateChangedEvent( state, oldState, - sm?.isResumed ?? false, ), ); } diff --git a/packages/moxxmpp/lib/src/events.dart b/packages/moxxmpp/lib/src/events.dart index 0ab0929..2905d44 100644 --- a/packages/moxxmpp/lib/src/events.dart +++ b/packages/moxxmpp/lib/src/events.dart @@ -22,10 +22,9 @@ abstract class XmppEvent {} /// Triggered when the connection state of the XmppConnection has /// changed. class ConnectionStateChangedEvent extends XmppEvent { - ConnectionStateChangedEvent(this.state, this.before, this.resumed); + ConnectionStateChangedEvent(this.state, this.before); final XmppConnectionState before; final XmppConnectionState state; - final bool resumed; /// Indicates whether the connection state switched from a not connected state to a /// connected state.