mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-17 08:55:12 +00:00
chore: Follow up status feature
This commit is contained in:
parent
fa543e93b8
commit
28c3efae23
1 changed files with 9 additions and 5 deletions
|
@ -480,6 +480,8 @@ class ChatListController extends State<ChatList>
|
||||||
}
|
}
|
||||||
|
|
||||||
void setStatus() async {
|
void setStatus() async {
|
||||||
|
final client = Matrix.of(context).client;
|
||||||
|
final currentPresence = await client.fetchCurrentPresence(client.userID!);
|
||||||
final input = await showTextInputDialog(
|
final input = await showTextInputDialog(
|
||||||
useRootNavigator: false,
|
useRootNavigator: false,
|
||||||
context: context,
|
context: context,
|
||||||
|
@ -493,14 +495,16 @@ class ChatListController extends State<ChatList>
|
||||||
maxLines: 6,
|
maxLines: 6,
|
||||||
minLines: 1,
|
minLines: 1,
|
||||||
maxLength: 255,
|
maxLength: 255,
|
||||||
|
initialText: currentPresence.statusMsg,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
if (input == null) return;
|
if (input == null) return;
|
||||||
|
if (!mounted) return;
|
||||||
await showFutureLoadingDialog(
|
await showFutureLoadingDialog(
|
||||||
context: context,
|
context: context,
|
||||||
future: () => Matrix.of(context).client.setPresence(
|
future: () => client.setPresence(
|
||||||
Matrix.of(context).client.userID!,
|
client.userID!,
|
||||||
PresenceType.online,
|
PresenceType.online,
|
||||||
statusMsg: input.single,
|
statusMsg: input.single,
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue