Add support for business and gov verification
Also improve icon rendering on Firefox
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import options
|
||||
import jsony
|
||||
import user, ../types/[graphuser, graphlistmembers]
|
||||
from ../../types import User, Result, Query, QueryKind
|
||||
from ../../types import User, VerifiedType, Result, Query, QueryKind
|
||||
|
||||
proc parseGraphUser*(json: string): User =
|
||||
if json.len == 0 or json[0] != '{':
|
||||
@@ -14,7 +14,8 @@ proc parseGraphUser*(json: string): User =
|
||||
|
||||
result = raw.data.userResult.result.legacy
|
||||
result.id = raw.data.userResult.result.restId
|
||||
result.verified = result.verified or raw.data.userResult.result.isBlueVerified
|
||||
if result.verifiedType == none and raw.data.userResult.result.isBlueVerified:
|
||||
result.verifiedType = blue
|
||||
|
||||
proc parseGraphListMembers*(json, cursor: string): Result[User] =
|
||||
result = Result[User](
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import std/[options, tables, strutils, strformat, sugar]
|
||||
import jsony
|
||||
import user
|
||||
import ../types/unifiedcard
|
||||
import user, ../types/unifiedcard
|
||||
from ../../types import Card, CardKind, Video
|
||||
from ../../utils import twimg, https
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ proc toUser*(raw: RawUser): User =
|
||||
tweets: raw.statusesCount,
|
||||
likes: raw.favouritesCount,
|
||||
media: raw.mediaCount,
|
||||
verified: raw.verified or raw.extIsBlueVerified,
|
||||
verifiedType: raw.verifiedType,
|
||||
protected: raw.protected,
|
||||
joinDate: parseTwitterDate(raw.createdAt),
|
||||
banner: getBanner(raw),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import options
|
||||
import common
|
||||
from ../../types import VerifiedType
|
||||
|
||||
type
|
||||
RawUser* = object
|
||||
@@ -15,8 +16,7 @@ type
|
||||
favouritesCount*: int
|
||||
statusesCount*: int
|
||||
mediaCount*: int
|
||||
verified*: bool
|
||||
extIsBlueVerified*: bool
|
||||
verifiedType*: VerifiedType
|
||||
protected*: bool
|
||||
profileLinkColor*: string
|
||||
profileBannerUrl*: string
|
||||
|
||||
Reference in New Issue
Block a user