mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 08:25:12 +00:00
fix: Resend status message
This commit is contained in:
parent
7639bd8790
commit
481e134f30
1 changed files with 13 additions and 14 deletions
|
@ -79,9 +79,20 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
|
||||
File wallpaper;
|
||||
|
||||
void _initWithStore() {
|
||||
void _initWithStore() async {
|
||||
try {
|
||||
client.init();
|
||||
await client.init();
|
||||
if (client.isLogged()) {
|
||||
final statusMsg = await store.getItem(SettingKeys.ownStatusMessage);
|
||||
if (statusMsg?.isNotEmpty ?? false) {
|
||||
Logs().v('Send cached status message: "$statusMsg"');
|
||||
await client.sendPresence(
|
||||
client.userID,
|
||||
PresenceType.online,
|
||||
statusMsg: statusMsg,
|
||||
);
|
||||
}
|
||||
}
|
||||
} catch (e, s) {
|
||||
client.onLoginStateChanged.sink.addError(e, s);
|
||||
SentryController.captureException(e, s);
|
||||
|
@ -323,18 +334,6 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
SettingKeys.ownStatusMessage, presence.presence.statusMsg);
|
||||
}
|
||||
});
|
||||
if (client.isLogged()) {
|
||||
store.getItem(SettingKeys.ownStatusMessage).then((statusMsg) {
|
||||
if (statusMsg?.isNotEmpty ?? false) {
|
||||
Logs().v('Send cached status message: "$statusMsg"');
|
||||
client.sendPresence(
|
||||
client.userID,
|
||||
PresenceType.online,
|
||||
statusMsg: statusMsg,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onUiaRequest ??= client.onUiaRequest.stream.listen(_onUiaRequest);
|
||||
if (PlatformInfos.isWeb || PlatformInfos.isLinux) {
|
||||
|
|
Loading…
Reference in a new issue