Skip to content

Commit d50235e

Browse files
committed
fix: ending of following & followers timeline.
1 parent 67a20b0 commit d50235e

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

twitterv1/user.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,22 @@ func GetFollowers(c *fiber.Ctx) error {
531531
cursor = ""
532532
}
533533

534+
if cursorInt == 0 {
535+
return EncodeAndSend(c, struct {
536+
Users []bridge.TwitterUser `json:"users" xml:"users"`
537+
NextCursor uint64 `json:"next_cursor" xml:"next_cursor"`
538+
PreviousCursor uint64 `json:"previous_cursor" xml:"previous_cursor"`
539+
NextCursorStr string `json:"next_cursor_str" xml:"-"`
540+
PreviousCursorStr string `json:"previous_cursor_str" xml:"-"`
541+
}{
542+
Users: []bridge.TwitterUser{},
543+
NextCursor: 0,
544+
PreviousCursor: 0, // Unimplemented. This could probably be figured out if i could figure out what the TID corrisponds to, if it corrisponds to anything at all.
545+
NextCursorStr: "0",
546+
PreviousCursorStr: "0",
547+
})
548+
}
549+
534550
// fetch followers
535551
followers, err := blueskyapi.GetFollowers(*pds, *oauthToken, cursor, actor)
536552
if err != nil {
@@ -687,6 +703,22 @@ func GetFollows(c *fiber.Ctx) error {
687703
cursor = ""
688704
}
689705

706+
if cursorInt == 0 {
707+
return EncodeAndSend(c, struct {
708+
Users []bridge.TwitterUser `json:"users" xml:"users"`
709+
NextCursor uint64 `json:"next_cursor" xml:"next_cursor"`
710+
PreviousCursor uint64 `json:"previous_cursor" xml:"previous_cursor"`
711+
NextCursorStr string `json:"next_cursor_str" xml:"-"`
712+
PreviousCursorStr string `json:"previous_cursor_str" xml:"-"`
713+
}{
714+
Users: []bridge.TwitterUser{},
715+
NextCursor: 0,
716+
PreviousCursor: 0, // Unimplemented. This could probably be figured out if i could figure out what the TID corrisponds to, if it corrisponds to anything at all.
717+
NextCursorStr: "0",
718+
PreviousCursorStr: "0",
719+
})
720+
}
721+
690722
// fetch follows
691723
followers, err := blueskyapi.GetFollows(*pds, *oauthToken, cursor, actor)
692724
if err != nil {

0 commit comments

Comments
 (0)