Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifying thread_message_limit when requesting the Inbox #250

Closed
mycroftcanner opened this issue Jun 21, 2021 · 1 comment
Closed

Modifying thread_message_limit when requesting the Inbox #250

mycroftcanner opened this issue Jun 21, 2021 · 1 comment

Comments

@mycroftcanner
Copy link
Contributor

Hi,

I am attempting to increase the number of messages returned per thread when fetching the inbox.

In Swiftagram I see a value set as such with the .query.modifier:

["thread_message_limit": "10"]

How can we add this same functionality to SwiftyInsta?

I tried adding it to the body and headers parameter for the inbox function but that didn't seem to work.

Any ideas?

public final class MessageHandler: Handler {
    /// Get the user's inbox.
    public func inbox(with paginationParameters: PaginationParameters,
                      updateHandler: PaginationUpdateHandler<Thread, AnyPaginatedResponse>?,
                      completionHandler: @escaping PaginationCompletionHandler<Thread>) {
        let body = ["thread_message_limit": "10"]
      
        pages.request(Thread.self,
                      page: AnyPaginatedResponse.self,
                      with: paginationParameters,
                      endpoint: { Endpoint.Direct.inbox.next($0.nextMaxId) },
                      body: { _ in
                        .parameters(body)
                      },
                      headers: { _ in
                        body
                      },
                      next: { $0.inbox.oldestCursor.string },
                      splice: { $0.rawResponse.inbox.threads.array?.compactMap(Thread.init) ?? [] },
                      update: updateHandler,
                      completion: completionHandler)
    }
@github-actions
Copy link

Hey @mycroftcanner,

This repo is not currenlty maintained.
Please refer to #244 for more info on alternatives or how you can help.

For crashes alone, please reply under this by mentioning @sbertix.
If no exception is ever raised in your code and the feature is simply not behaving as expected or as it used to, this will likely not be fixed at the moment.
Your issue, however, will not be closed, in hopes of SwiftyInsta being maintained again.

@sbertix sbertix closed this as completed Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants