service: Fix crash in the roster service

This commit is contained in:
PapaTutuWawa committed 2022-03-03 14:23:29 +01:00
1 parent 9144ab7493
commit 2804636fa2
1 file changed
+2 -7
+2 -7
View File
@@ -100,7 +100,7 @@ class RosterService {
// Handle modified and new items
for (final item in currentRoster) {
if (listContains(result, (RosterItem i) => i.jid == item.jid)) {
if (listContains(result.items, (RosterItem i) => i.jid == item.jid)) {
// TODO: Diff and update if needed
modifiedItems.add(item);
} else {
@@ -116,7 +116,7 @@ class RosterService {
}
// Handle deleted items
for (final item in result) {
for (final item in result.items) {
if (!listContains(currentRoster, (RosterItem i) => i.jid == item.jid)) {
newItems.add(await db.addRosterItemFromData(
"",
@@ -126,11 +126,6 @@ class RosterService {
}
}
// TODO: REMOVE
final jids = (await db.getRoster()).map((item) => item.jid).toList();
_log.finest("Current roster: " + jids.toString());
// TODO END
sendData(RosterDiffEvent(
newItems: newItems,
removedItems: removedItems,