refactor: Update to Matrix Dart SDK 0.29.9
This commit is contained in:
parent
bfd8d7f99c
commit
3d35a6adcf
10 changed files with 62 additions and 17 deletions
|
|
@ -266,6 +266,10 @@ extension JoinRulesDisplayString on JoinRules {
|
|||
return l10n.usersMustKnock;
|
||||
case JoinRules.private:
|
||||
return l10n.noOneCanJoin;
|
||||
case JoinRules.restricted:
|
||||
return l10n.restricted;
|
||||
case JoinRules.knockRestricted:
|
||||
return l10n.knockRestricted;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,8 +62,14 @@ class SettingsIgnoreListView extends StatelessWidget {
|
|||
),
|
||||
Expanded(
|
||||
child: StreamBuilder<Object>(
|
||||
stream: client.onAccountData.stream
|
||||
.where((a) => a.type == 'm.ignored_user_list'),
|
||||
stream: client.onSync.stream.where(
|
||||
(syncUpdate) =>
|
||||
syncUpdate.accountData?.any(
|
||||
(accountData) =>
|
||||
accountData.type == 'm.ignored_user_list',
|
||||
) ??
|
||||
false,
|
||||
),
|
||||
builder: (context, snapshot) {
|
||||
return ListView.builder(
|
||||
itemCount: client.ignoredUsers.length,
|
||||
|
|
|
|||
|
|
@ -22,11 +22,13 @@ class SettingsNotificationsView extends StatelessWidget {
|
|||
),
|
||||
body: MaxWidthBody(
|
||||
child: StreamBuilder(
|
||||
stream: Matrix.of(context)
|
||||
.client
|
||||
.onAccountData
|
||||
.stream
|
||||
.where((event) => event.type == 'm.push_rules'),
|
||||
stream: Matrix.of(context).client.onSync.stream.where(
|
||||
(syncUpdate) =>
|
||||
syncUpdate.accountData?.any(
|
||||
(accountData) => accountData.type == 'm.push_rules',
|
||||
) ??
|
||||
false,
|
||||
),
|
||||
builder: (BuildContext context, _) {
|
||||
return Column(
|
||||
children: [
|
||||
|
|
|
|||
|
|
@ -205,10 +205,14 @@ class SettingsStyleView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
StreamBuilder(
|
||||
stream: client.onAccountData.stream.where(
|
||||
(data) =>
|
||||
data.type ==
|
||||
ApplicationAccountConfigExtension.accountDataKey,
|
||||
stream: client.onSync.stream.where(
|
||||
(syncUpdate) =>
|
||||
syncUpdate.accountData?.any(
|
||||
(accountData) =>
|
||||
accountData.type ==
|
||||
ApplicationAccountConfigExtension.accountDataKey,
|
||||
) ??
|
||||
false,
|
||||
),
|
||||
builder: (context, snapshot) {
|
||||
final accountConfig = client.applicationAccountConfig;
|
||||
|
|
|
|||
|
|
@ -37,9 +37,15 @@ class ChatSettingsPopupMenuState extends State<ChatSettingsPopupMenu> {
|
|||
Widget build(BuildContext context) {
|
||||
notificationChangeSub ??= Matrix.of(context)
|
||||
.client
|
||||
.onAccountData
|
||||
.onSync
|
||||
.stream
|
||||
.where((u) => u.type == 'm.push_rules')
|
||||
.where(
|
||||
(syncUpdate) =>
|
||||
syncUpdate.accountData?.any(
|
||||
(accountData) => accountData.type == 'm.push_rules',
|
||||
) ??
|
||||
false,
|
||||
)
|
||||
.listen(
|
||||
(u) => setState(() {}),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue