Share filters with web client (#956)
* First step toward synchronized content filters * Add simple filter management UI * Remove old regex filter UI * More cleanup * Escape filter phrases when applying them via regex * Apply code review feedback * Fix live timeline update when filters change
This commit is contained in:
parent
463b008090
commit
5135daad2c
13 changed files with 439 additions and 91 deletions
|
@ -22,6 +22,7 @@ import com.keylesspalace.tusky.entity.Attachment;
|
|||
import com.keylesspalace.tusky.entity.Card;
|
||||
import com.keylesspalace.tusky.entity.Conversation;
|
||||
import com.keylesspalace.tusky.entity.Emoji;
|
||||
import com.keylesspalace.tusky.entity.Filter;
|
||||
import com.keylesspalace.tusky.entity.Instance;
|
||||
import com.keylesspalace.tusky.entity.MastoList;
|
||||
import com.keylesspalace.tusky.entity.Notification;
|
||||
|
@ -346,4 +347,37 @@ public interface MastodonApi {
|
|||
|
||||
@GET("/api/v1/conversations")
|
||||
Call<List<Conversation>> getConversations(@Nullable @Query("max_id") String maxId, @Query("limit") int limit);
|
||||
@GET("api/v1/filters")
|
||||
Call<List<Filter>> getFilters();
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("api/v1/filters")
|
||||
Call<Filter> createFilter(
|
||||
@Field("phrase") String phrase,
|
||||
@Field("context[]") List<String> context,
|
||||
@Field("irreversible") Boolean irreversible,
|
||||
@Field("whole_word") Boolean wholeWord,
|
||||
@Field("expires_in") String expiresIn
|
||||
);
|
||||
|
||||
@GET("api/v1/filters/{id}")
|
||||
Call<Filter> getFilter(
|
||||
@Path("id") String id
|
||||
);
|
||||
|
||||
@FormUrlEncoded
|
||||
@PUT("api/v1/filters/{id}")
|
||||
Call<Filter> updateFilter(
|
||||
@Path("id") String id,
|
||||
@Field("phrase") String phrase,
|
||||
@Field("context[]") List<String> context,
|
||||
@Field("irreversible") Boolean irreversible,
|
||||
@Field("whole_word") Boolean wholeWord,
|
||||
@Field("expires_in") String expiresIn
|
||||
);
|
||||
|
||||
@DELETE("api/v1/filters/{id}")
|
||||
Call<ResponseBody> deleteFilter(
|
||||
@Path("id") String id
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue