increased delay to get more messages. improved mention formatting a bit

This commit is contained in:
vishalxl 2022-08-12 17:49:45 +05:30
parent f1d9968140
commit 9b215038b5
2 changed files with 4 additions and 8 deletions

View File

@ -93,7 +93,7 @@ Future<void> main(List<String> arguments) async {
int numUserEvents = 0, numFeedEvents = 0, numOtherEvents = 0;
const int numWaitSeconds = 2000;
const int numWaitSeconds = 3000;
stdout.write('Waiting for user events to come in....');
Future.delayed(const Duration(milliseconds: numWaitSeconds), () {
// count user events
@ -131,7 +131,7 @@ Future<void> main(List<String> arguments) async {
getMultiUserEvents(defaultServerUrl, pTags, events, 300);
print('Waiting for rest of events to come in....');
Future.delayed(const Duration(milliseconds: numWaitSeconds * 1), () {
Future.delayed(const Duration(milliseconds: numWaitSeconds * 2), () {
// count other events
events.forEach((element) { element.eventData.kind == 1? numOtherEvents++: numOtherEvents;});
numOtherEvents = numOtherEvents - numFeedEvents - numUserEvents;

View File

@ -193,11 +193,7 @@ class EventData {
return content;
}
String s = "";
List<String> placeHolders = ["#[0]", "#[1]", "#[2]", "#[3]" ];
List<String> placeHolders = ["#[0]", "#[1]", "#[2]", "#[3]", "#[4]", "#[5]" ];
for(int i = 0; i < placeHolders.length; i++) {
int index = -1;
Pattern p = placeHolders[i];
@ -215,7 +211,7 @@ class EventData {
//print("tags = $tags");
//print("in expandMentions: changing content at index i = $i");
content = "${content.substring(0, index)} @$author ${content.substring(index + 4)}";
content = "${content.substring(0, index)} @$author${content.substring(index + 4)}";
}
}