fixed issue where double top trees were built

when a dummy top tree was being received

As tested with event id 0245d18adb696127a6ba67e1be9c2f9ebd7ad61c28d9aae631c30b6d60392ee0
This commit is contained in:
Vishal 2022-11-26 01:27:54 +05:30
parent 04e83323e5
commit d6ae371623

View File

@ -1261,11 +1261,7 @@ class Store {
// its a replacement.
if( gDebug >= 0 && newEvent.eventData.id == gCheckEventId) log.info("In processIncoming: Replaced old dummy event of id: ${newEvent.eventData.id}");
tree.event = newEvent;
//tree = topPosts.removeAt(i);
allChildEventsMap[tree.event.eventData.id] = tree;
if( newEvent.eventData.createdAt > getSecondsDaysAgo(gDontHighlightEventsOlderThan)) {
newEventIdsSet.add(newEvent.eventData.id);
}
return;
}
}
@ -1275,7 +1271,6 @@ class Store {
// add to new-notification list only if this is a recent event ( because relays may send old events, and we dont want to highlight stale messages)
newEventIdsSet.add(newEvent.eventData.id);
});
// now go over the newly inserted event, and add it to the tree for kind 1 events, add 42 events to channels. rest ( such as kind 0, kind 3, kind 7) are ignored.