Add a check to prevent following someone twice

This commit is contained in:
FIGBERT 2021-03-19 17:30:36 -07:00
parent 76e05a1bfb
commit 69d4aaa803
No known key found for this signature in database
GPG Key ID: 67F1598D607A844B
1 changed files with 2 additions and 0 deletions

View File

@ -8,6 +8,8 @@ proc addUserToFollowing*(following, toAdd: string): string =
var updated = following.split(",")
if updated == @[""]:
return toAdd
elif toAdd in updated:
return following
else:
updated = concat(updated, @[toAdd])
result = updated.join(",")