23 InReplyToID int64 |
23 InReplyToID int64 |
24 MediaIDs []int64 |
24 MediaIDs []int64 |
25 Sensitive bool |
25 Sensitive bool |
26 SpoilerText string |
26 SpoilerText string |
27 Visibility string // "direct", "private", "unlisted" or "public" |
27 Visibility string // "direct", "private", "unlisted" or "public" |
|
28 } |
|
29 |
|
30 // getMultipleStatuses returns a list of status entities |
|
31 // If opts.All is true, several requests will be made until the API server |
|
32 // has nothing to return. |
|
33 func (mc *Client) getMultipleStatuses(endPoint string, params apiCallParams, lopt *LimitParams) ([]Status, error) { |
|
34 var statuses []Status |
|
35 var links apiLinks |
|
36 if err := mc.apiCall(endPoint, rest.Get, params, lopt, &links, &statuses); err != nil { |
|
37 return nil, err |
|
38 } |
|
39 if lopt != nil { // Fetch more pages to reach our limit |
|
40 var statusSlice []Status |
|
41 for (lopt.All || lopt.Limit > len(statuses)) && links.next != nil { |
|
42 newlopt := links.next |
|
43 links = apiLinks{} |
|
44 if err := mc.apiCall(endPoint, rest.Get, params, newlopt, &links, &statusSlice); err != nil { |
|
45 return nil, err |
|
46 } |
|
47 statuses = append(statuses, statusSlice...) |
|
48 statusSlice = statusSlice[:0] // Clear struct |
|
49 } |
|
50 } |
|
51 return statuses, nil |
28 } |
52 } |
29 |
53 |
30 // queryStatusData queries the statuses API |
54 // queryStatusData queries the statuses API |
31 // The operation 'op' can be empty or "status" (the status itself), "context", |
55 // The operation 'op' can be empty or "status" (the status itself), "context", |
32 // "card", "reblogged_by", "favourited_by". |
56 // "card", "reblogged_by", "favourited_by". |