Rework profile cache behavior, fix suspended cache

Fixes #480
This commit is contained in:
Zed
2022-01-16 20:32:45 +01:00
parent 23f87c115a
commit f3d6f53f6d
4 changed files with 20 additions and 21 deletions

View File

@@ -38,10 +38,10 @@ proc getBanner(user: User): string =
return '#' & user.profileLinkColor
return "#161616"
proc parseUser*(json: string): Profile =
proc parseUser*(json: string; username=""): Profile =
handleErrors:
case error.code
of suspended: return Profile(suspended: true)
of suspended: return Profile(username: username, suspended: true)
of userNotFound: return
else: echo "[error - parseUser]: ", error