Improve notifications fetching (#1930)
* Improve notifications fetching - Only fetch notifications up to the latest fetched one - Use timeline markers to avoid showing already seen notifications * Apply some of the suggestions
This commit is contained in:
parent
17b7abb537
commit
e4c10f1ca4
7 changed files with 150 additions and 65 deletions
|
|
@ -99,11 +99,19 @@ interface MastodonApi {
|
|||
@Query("exclude_types[]") excludes: Set<Notification.Type>?
|
||||
): Call<List<Notification>>
|
||||
|
||||
@GET("api/v1/markers")
|
||||
fun markersWithAuth(
|
||||
@Header("Authorization") auth: String,
|
||||
@Header(DOMAIN_HEADER) domain: String,
|
||||
@Query("timeline[]") timelines: List<String>
|
||||
): Single<Map<String, Marker>>
|
||||
|
||||
@GET("api/v1/notifications")
|
||||
fun notificationsWithAuth(
|
||||
@Header("Authorization") auth: String,
|
||||
@Header(DOMAIN_HEADER) domain: String
|
||||
): Call<List<Notification>>
|
||||
@Header(DOMAIN_HEADER) domain: String,
|
||||
@Query("since_id") sinceId: String?
|
||||
): Single<List<Notification>>
|
||||
|
||||
@POST("api/v1/notifications/clear")
|
||||
fun clearNotifications(): Call<ResponseBody>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue