service: Show 'Idle' in the notification when we're not logged in

This commit is contained in:
PapaTutuWawa 2022-04-15 23:34:39 +02:00
parent 729abc2595
commit 09a8d909b9

View File

@ -165,7 +165,7 @@ void onStart(ServiceInstance service) {
GetIt.I.registerSingleton<Logger>(Logger("XmppService"));
service.on("command").listen(handleEvent);
service.setForegroundNotificationInfo(title: "Moxxy", content: "Connecting...");
service.setForegroundNotificationInfo(title: "Moxxy", content: "Preparing...");
GetIt.I.get<Logger>().finest("Running...");
@ -221,7 +221,11 @@ void onStart(ServiceInstance service) {
final settings = await xmpp.getConnectionSettings();
if (settings != null) {
// The title of the notification will be changed as soon as the connection state
// of [XmppConnection] changes.
xmpp.connect(settings, false);
} else {
GetIt.I.get<AndroidServiceInstance>().setForegroundNotificationInfo(title: "Moxxy", content: "Idle");
}
GetIt.I.get<Completer>().complete();