Implement optional notifications muting for account muting (#1856)

This commit is contained in:
Mélanie Chauvel 2020-07-27 10:28:59 +02:00 committed by GitHub
commit b3b4794a2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 240 additions and 49 deletions

View file

@ -317,9 +317,11 @@ interface MastodonApi {
@Path("id") accountId: String
): Call<Relationship>
@FormUrlEncoded
@POST("api/v1/accounts/{id}/mute")
fun muteAccount(
@Path("id") accountId: String
@Path("id") accountId: String,
@Field("notifications") notifications: Boolean
): Call<Relationship>
@POST("api/v1/accounts/{id}/unmute")

View file

@ -36,7 +36,7 @@ interface TimelineCases {
fun reblog(status: Status, reblog: Boolean): Single<Status>
fun favourite(status: Status, favourite: Boolean): Single<Status>
fun bookmark(status: Status, bookmark: Boolean): Single<Status>
fun mute(id: String)
fun mute(id: String, notifications: Boolean)
fun block(id: String)
fun delete(id: String): Single<DeletedStatus>
fun pin(status: Status, pin: Boolean)
@ -107,8 +107,8 @@ class TimelineCasesImpl(
}
}
override fun mute(id: String) {
val call = mastodonApi.muteAccount(id)
override fun mute(id: String, notifications: Boolean) {
val call = mastodonApi.muteAccount(id, notifications)
call.enqueue(object : Callback<Relationship> {
override fun onResponse(call: Call<Relationship>, response: Response<Relationship>) {}