service: Fix crash in the roster service
This commit is contained in:
parent
9144ab7493
commit
2804636fa2
@ -100,7 +100,7 @@ class RosterService {
|
|||||||
|
|
||||||
// Handle modified and new items
|
// Handle modified and new items
|
||||||
for (final item in currentRoster) {
|
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
|
// TODO: Diff and update if needed
|
||||||
modifiedItems.add(item);
|
modifiedItems.add(item);
|
||||||
} else {
|
} else {
|
||||||
@ -116,7 +116,7 @@ class RosterService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Handle deleted items
|
// Handle deleted items
|
||||||
for (final item in result) {
|
for (final item in result.items) {
|
||||||
if (!listContains(currentRoster, (RosterItem i) => i.jid == item.jid)) {
|
if (!listContains(currentRoster, (RosterItem i) => i.jid == item.jid)) {
|
||||||
newItems.add(await db.addRosterItemFromData(
|
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(
|
sendData(RosterDiffEvent(
|
||||||
newItems: newItems,
|
newItems: newItems,
|
||||||
removedItems: removedItems,
|
removedItems: removedItems,
|
||||||
|
Loading…
Reference in New Issue
Block a user