|
@@ -24,15 +24,15 @@ proc parseProfile(js: JsonNode; id=""): Profile =
|
|
|
|
|
|
|
|
result.expandProfileEntities(js)
|
|
result.expandProfileEntities(js)
|
|
|
|
|
|
|
|
-proc parseUserShow*(js: JsonNode; username: string): Profile =
|
|
|
|
|
- if js.isNull: return
|
|
|
|
|
|
|
+proc parseUserLookup*(js: JsonNode; username: string): Profile =
|
|
|
|
|
+ if js.isNull or js.kind == JArray and js.len == 0: return
|
|
|
with error, js{"errors"}:
|
|
with error, js{"errors"}:
|
|
|
result = Profile(username: username)
|
|
result = Profile(username: username)
|
|
|
if error.getError == suspended:
|
|
if error.getError == suspended:
|
|
|
result.suspended = true
|
|
result.suspended = true
|
|
|
return
|
|
return
|
|
|
|
|
|
|
|
- result = parseProfile(js)
|
|
|
|
|
|
|
+ result = parseProfile(js[0])
|
|
|
|
|
|
|
|
proc parseGraphProfile*(js: JsonNode; username: string): Profile =
|
|
proc parseGraphProfile*(js: JsonNode; username: string): Profile =
|
|
|
if js.isNull: return
|
|
if js.isNull: return
|