Support setting filter expirations (#2667)
* Show filter expiration in list * Add support for setting and updating the duration of a filter * Add tests for duration conversion math * Refactor network wrapper code * Mark updated mastodon api functions as suspend * Avoid creating unnecessary Date objects * Apply suggestions to filter dialog layout
This commit is contained in:
parent
9beea540de
commit
c47d9ef6ac
7 changed files with 197 additions and 100 deletions
|
|
@ -531,29 +531,29 @@ interface MastodonApi {
|
|||
|
||||
@FormUrlEncoded
|
||||
@POST("api/v1/filters")
|
||||
fun createFilter(
|
||||
suspend fun createFilter(
|
||||
@Field("phrase") phrase: String,
|
||||
@Field("context[]") context: List<String>,
|
||||
@Field("irreversible") irreversible: Boolean?,
|
||||
@Field("whole_word") wholeWord: Boolean?,
|
||||
@Field("expires_in") expiresIn: Int?
|
||||
): Call<Filter>
|
||||
@Field("expires_in") expiresInSeconds: Int?
|
||||
): NetworkResult<Filter>
|
||||
|
||||
@FormUrlEncoded
|
||||
@PUT("api/v1/filters/{id}")
|
||||
fun updateFilter(
|
||||
suspend fun updateFilter(
|
||||
@Path("id") id: String,
|
||||
@Field("phrase") phrase: String,
|
||||
@Field("context[]") context: List<String>,
|
||||
@Field("irreversible") irreversible: Boolean?,
|
||||
@Field("whole_word") wholeWord: Boolean?,
|
||||
@Field("expires_in") expiresIn: Int?
|
||||
): Call<Filter>
|
||||
@Field("expires_in") expiresInSeconds: Int?
|
||||
): NetworkResult<Filter>
|
||||
|
||||
@DELETE("api/v1/filters/{id}")
|
||||
fun deleteFilter(
|
||||
suspend fun deleteFilter(
|
||||
@Path("id") id: String
|
||||
): Call<ResponseBody>
|
||||
): NetworkResult<ResponseBody>
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("api/v1/polls/{id}/votes")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue