Explorar o código

Fix timeline parser

Zed %!s(int64=4) %!d(string=hai) anos
pai
achega
adfd31c530
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      src/parser.nim

+ 6 - 1
src/parser.nim

@@ -375,7 +375,12 @@ proc parseTimeline*(js: JsonNode; after=""): Timeline =
 
   result.parseInstructions(global, instructions)
 
-  for e in instructions[0]{"addEntries", "entries"}:
+  var entries: JsonNode
+  for i in instructions:
+    if "addEntries" in i:
+      entries = i{"addEntries", "entries"}
+
+  for e in ? entries:
     let entry = e{"entryId"}.getStr
     if "tweet" in entry or entry.startsWith("sq-I-t") or "tombstone" in entry:
       let tweet = finalizeTweet(global, e.getEntryId)