Skip to content

Commit

Permalink
refactor: update jabberID and streamline event handler syntax in inbo…
Browse files Browse the repository at this point in the history
…x.dart
  • Loading branch information
vsevex committed Jan 2, 2025
1 parent 841c8b0 commit ca55930
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions example/inbox.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import 'package:whixp/src/plugins/inbox/inbox.dart';
import 'package:whixp/whixp.dart';

void main() {
final whixp = Whixp(
jabberID: 'asdf@localhost',
jabberID: 'vsevex@localhost/resource',
password: 'passwd',
logger: Log(
enableWarning: true,
Expand All @@ -14,9 +13,7 @@ void main() {
);

whixp
..addEventHandler('streamNegotiated', (_) {
return getInbox();
})
..addEventHandler('streamNegotiated', (_) => getInbox())
..addEventHandler<Message>('message', (message) {
final result = message?.get<InboxResult>();
if (result?.isNotEmpty ?? false) {
Expand All @@ -27,7 +24,8 @@ void main() {
}
Log.instance.info("marked: ${forwarded?.actual?.isMarked}");
Log.instance.info(
"box: ${stanza.box} \t archive: ${stanza.archive} \t mute: ${stanza.mute}");
"box: ${stanza.box} \t archive: ${stanza.archive} \t mute: ${stanza.mute}",
);
Log.instance.info(
"from: ${forwarded?.actual?.from?.username} \t to: ${forwarded?.actual?.to?.username}",
);
Expand Down

0 comments on commit ca55930

Please sign in to comment.