MastodonApi: add support for subscribing endpoints and subscribing status field

main
Alibek Omarov 4 years ago
parent 82aac35fdb
commit d82ca3df9b
  1. 3
      app/src/main/java/com/keylesspalace/tusky/entity/Relationship.kt
  2. 20
      app/src/main/java/com/keylesspalace/tusky/network/MastodonApi.kt

@ -24,5 +24,6 @@ data class Relationship (
val blocking: Boolean,
val muting: Boolean,
val requested: Boolean,
@SerializedName("showing_reblogs") val showingReblogs: Boolean
@SerializedName("showing_reblogs") val showingReblogs: Boolean,
val subscribing: Boolean? = null // Pleroma extension
)

@ -325,6 +325,16 @@ interface MastodonApi {
fun identityProofs(
@Path("id") accountId: String
): Call<List<IdentityProof>>
@POST("api/v1/pleroma/accounts/{id}/subscribe")
fun subscribeAccount(
@Path("id") accountId: String
): Call<Relationship>
@POST("api/v1/pleroma/accounts/{id}/unsubscribe")
fun unsubscribeAccount(
@Path("id") accountId: String
): Call<Relationship>
@GET("api/v1/blocks")
fun blocks(
@ -498,6 +508,16 @@ interface MastodonApi {
fun unmuteAccountObservable(
@Path("id") accountId: String
): Single<Relationship>
@POST("api/v1/pleroma/accounts/{id}/subscribe")
fun subscribeAccountObservable(
@Path("id") accountId: String
): Single<Relationship>
@POST("api/v1/pleroma/accounts/{id}/unsubscribe")
fun unsubscribeAccountObservable(
@Path("id") accountId: String
): Single<Relationship>
@GET("api/v1/accounts/relationships")
fun relationshipsObservable(

Loading…
Cancel
Save