add following & followed by to profile

This commit is contained in:
Valentine 2024-02-21 06:21:49 +03:00
parent cf6de782e0
commit 5dee67c2da
3 changed files with 5 additions and 0 deletions

View file

@ -34,6 +34,8 @@ type Profile struct {
Username string Username string
Website string Website string
Sensitive bool Sensitive bool
Following bool
FollowedBy bool
} }
type user struct { type user struct {

View file

@ -171,6 +171,7 @@ type (
} }
legacyUserV2 struct { legacyUserV2 struct {
FollowedBy bool `json:"followed_by"`
Following bool `json:"following"` Following bool `json:"following"`
CanDm bool `json:"can_dm"` CanDm bool `json:"can_dm"`
CanMediaTag bool `json:"can_media_tag"` CanMediaTag bool `json:"can_media_tag"`

View file

@ -387,6 +387,8 @@ func parseProfileV2(user userResult) Profile {
UserID: user.ID, UserID: user.ID,
Username: u.ScreenName, Username: u.ScreenName,
Sensitive: u.PossiblySensitive, Sensitive: u.PossiblySensitive,
Following: u.Following,
FollowedBy: u.FollowedBy,
} }
tm, err := time.Parse(time.RubyDate, u.CreatedAt) tm, err := time.Parse(time.RubyDate, u.CreatedAt)