mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-05-14 02:27:40 +02:00
have Matrix.getBundles() use client instead of clientIndex
This commit is contained in:
parent
7c40f72f55
commit
a973f8d371
@ -77,8 +77,8 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||||||
return activeClient;
|
return activeClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, List<int>> getBundles() {
|
Map<String, List<Client>> getBundles() {
|
||||||
final resBundles = <String, List<_AccountBundleWithClientIndex>>{};
|
final resBundles = <String, List<_AccountBundleWithClient>>{};
|
||||||
for (var i = 0; i < widget.clients.length; i++) {
|
for (var i = 0; i < widget.clients.length; i++) {
|
||||||
final bundles = widget.clients[i].accountBundles;
|
final bundles = widget.clients[i].accountBundles;
|
||||||
for (final bundle in bundles) {
|
for (final bundle in bundles) {
|
||||||
@ -86,8 +86,8 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
resBundles[bundle.name] ??= [];
|
resBundles[bundle.name] ??= [];
|
||||||
resBundles[bundle.name].add(_AccountBundleWithClientIndex(
|
resBundles[bundle.name].add(_AccountBundleWithClient(
|
||||||
index: i,
|
client: widget.clients[i],
|
||||||
bundle: bundle,
|
bundle: bundle,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -100,7 +100,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||||||
: a.bundle.priority.compareTo(b.bundle.priority));
|
: a.bundle.priority.compareTo(b.bundle.priority));
|
||||||
}
|
}
|
||||||
return resBundles
|
return resBundles
|
||||||
.map((k, v) => MapEntry(k, v.map((vv) => vv.index).toList()));
|
.map((k, v) => MapEntry(k, v.map((vv) => vv.client).toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get hasComplexBundles => getBundles().values.any((v) => v.length > 1);
|
bool get hasComplexBundles => getBundles().values.any((v) => v.length > 1);
|
||||||
@ -597,8 +597,8 @@ class FixedThreepidCreds extends ThreepidCreds {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _AccountBundleWithClientIndex {
|
class _AccountBundleWithClient {
|
||||||
final int index;
|
final Client client;
|
||||||
final AccountBundle bundle;
|
final AccountBundle bundle;
|
||||||
_AccountBundleWithClientIndex({this.index, this.bundle});
|
_AccountBundleWithClient({this.client, this.bundle});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user