feat: Do not fetch bundles for our own device

This commit is contained in:
PapaTutuWawa 2023-01-02 13:56:22 +01:00
parent 3825232ebe
commit a08c654295

View File

@ -408,9 +408,12 @@ class OmemoManager {
if (bundlesToFetch.isNotEmpty) { if (bundlesToFetch.isNotEmpty) {
_log.finest('Fetching bundles $bundlesToFetch for $jid'); _log.finest('Fetching bundles $bundlesToFetch for $jid');
} }
final device = await getDevice();
final newBundles = List<OmemoBundle>.empty(growable: true); final newBundles = List<OmemoBundle>.empty(growable: true);
for (final id in bundlesToFetch) { for (final id in bundlesToFetch) {
if (jid == device.jid && id == device.id) continue;
final bundle = await fetchDeviceBundleImpl(jid, id); final bundle = await fetchDeviceBundleImpl(jid, id);
if (bundle != null) newBundles.add(bundle); if (bundle != null) newBundles.add(bundle);
} }