fetched default accounts in first step itself

This commit is contained in:
Vishal 2022-09-09 14:32:56 +05:30
parent c7153872d9
commit e16fb421f4
3 changed files with 8 additions and 5 deletions

View File

@ -237,7 +237,9 @@ Future<void> main(List<String> arguments) async {
return;
}
getUserEvents(gListRelayUrls1, userPublicKey, gLimitPerSubscription, getSecondsDaysAgo(gDaysToGetEventsFor));
gDefaultFollows.add(userPublicKey);
//getUserEvents(gListRelayUrls1, userPublicKey, gLimitPerSubscription, getSecondsDaysAgo(gDaysToGetEventsFor));
getMultiUserEvents(gListRelayUrls1, gDefaultFollows, 1000, getSecondsDaysAgo(gDaysToGetEventsFor));
getMentionEvents(gListRelayUrls2, userPublicKey, gLimitPerSubscription, getSecondsDaysAgo(gDaysToGetEventsFor)); // from relay group 2
getKindEvents([0,3, 40, 42], gListRelayUrls1, gLimitPerSubscription, getSecondsDaysAgo(gDaysToGetEventsFor* 10));
@ -264,7 +266,7 @@ Future<void> main(List<String> arguments) async {
// if contact list was found, get user's feed; also get some default contacts
Set<String> contacts = {};
contacts.addAll(gDefaultFollows);
//contacts.addAll(gDefaultFollows);
if (contactEvent != null ) {
if(gDebug > 0) print("In main: found contact list: \n ${contactEvent.originalJson}");
contactEvent.eventData.contactList.forEach((contact) {

View File

@ -637,6 +637,7 @@ bool processKind0Event(Event e) {
bool newEntry = false, entryModified = false;
if( !gKindONames.containsKey(e.eventData.pubkey)) {
gKindONames[e.eventData.pubkey] = UserNameInfo(e.eventData.createdAt, name, about, picture, null);
newEntry = true;;
} else {
int oldTime = gKindONames[e.eventData.pubkey]?.createdAt??0;

View File

@ -265,7 +265,7 @@ String getUserRequest(String subscriptionId, String publicKey, int numUserEvents
}
var strSubscription1 = '["REQ","$subscriptionId",{ "authors": ["';
var strSubscription2 ='"], "limit": $numUserEvents $strTime } ]';
return strSubscription1 + publicKey + strSubscription2;
return strSubscription1 + publicKey.toLowerCase() + strSubscription2;
}
@ -276,7 +276,7 @@ String getMentionRequest(String subscriptionId, String publicKey, int numUserEve
}
var strSubscription1 = '["REQ","$subscriptionId",{ "#p": ["';
var strSubscription2 ='"], "limit": $numUserEvents $strTime } ]';
return strSubscription1 + publicKey + strSubscription2;
return strSubscription1 + publicKey.toLowerCase() + strSubscription2;
}
String getMultiUserRequest(String subscriptionId, List<String> publicKeys, int numUserEvents, int sinceWhen) {
@ -290,7 +290,7 @@ String getMultiUserRequest(String subscriptionId, List<String> publicKeys, int n
String s = "";
for(int i = 0; i < publicKeys.length; i++) {
s += "\"${publicKeys[i]}\"";
s += "\"${publicKeys[i].toLowerCase()}\"";
if( i < publicKeys.length - 1) {
s += ",";
}