ensured that even if a user does not have a kind 0 event..

.. even then their pubkey is stored in the gKind0 store, so that their profile can still be looked up with profile view in 6 -> 1
This commit is contained in:
Vishal 2022-11-21 13:57:53 +05:30
parent 6ad8001ae8
commit d833677cf9
3 changed files with 10 additions and 6 deletions

View File

@ -304,7 +304,7 @@ class EventData {
String expandMentions(String content) {
if( id == gCheckEventId) {
printInColor("in expandMentions: decoding ee810ea73072af056cceaa6d051b4fcce60739247f7bcc752e72fa5defb64f09\n", redColor);
printInColor("in expandMentions: decoding $gCheckEventId\n", redColor);
}
if( tags.isEmpty) {
@ -335,7 +335,7 @@ class EventData {
// is called only once for each event received ( or read from file)
void translateAndExpandMentions(List<DirectMessageRoom> directRooms, Map<String, Tree> tempChildEventsMap) {
if( id == gCheckEventId) {
printInColor("in translateAndExpandMensitons: decoding ee810ea73072af056cceaa6d051b4fcce60739247f7bcc752e72fa5defb64f09\n", redColor);
printInColor("in translateAndExpandMensitons: decoding $gCheckEventId\n", redColor);
}
if (content == "" || evaluatedContent != "") {

View File

@ -11,7 +11,7 @@ int gSpecificDebug = 0;
final log = Logger('ExampleLogger');
// for debugging
String gCheckEventId = "fg ee810ea73072af056cceaa6d051b4fcce60739247f7bcc752e72fa5defb64f09";
String gCheckEventId = " e74e93fbc77af5275f29db688931f725813ab1385f16233bfa609078a8779dfa";
int gDefaultNumWaitSeconds = 6000; // is used in main()

View File

@ -852,6 +852,7 @@ class Store {
}
if(tree.event.eventData.eTags.isNotEmpty ) {
// is not a parent, find its parent and then add this element to that parent Tree
String parentId = tree.event.eventData.getParent(tempChildEventsMap);
@ -874,9 +875,12 @@ class Store {
topLevelTrees.add(dummyTopNode);
// dont add this dummy in dummyEventIds list ( cause that's used to fetch events not in store)
if( gDebug > 0) log.info("In Tree.fromEvents: got a kind 1 event whose parent is not a type 1 post: $newEventId . parent kind: ${tempChildEventsMap[parentId]?.event.eventData.kind}");
} else {
tempChildEventsMap[parentId]?.children.add(tree);
tempChildEventsMap[parentId]?.children.add(tree);
if( !gKindONames.containsKey(tree.event.eventData.pubkey)) {
gKindONames[tree.event.eventData.pubkey] = UserNameInfo(null, null, null, null, null );
}
}
} else {
// in case where the parent of the new event is not in the pool of all events,
@ -929,7 +933,7 @@ class Store {
// get dummy events
sendEventsRequest(gListRelayUrls1, dummyEventIds);
//log.info("In fromEvents After calling SendEventsRequest for ${dummyEventIds.length} dummy evnets");
//log.info("In fromEvents After calling SendEventsRequest for ${dummyEventIds.length} dummy evnets ids: $dummyEventIds");
// create a dummy top level tree and then create the main Tree object
return Store( topLevelTrees, tempChildEventsMap, tempWithoutParent, channels, encryptedChannels, tempDirectRooms);