diff --git a/app/src/main/java/com/keylesspalace/tusky/appstore/Events.kt b/app/src/main/java/com/keylesspalace/tusky/appstore/Events.kt index b856b9e6..ed4477a7 100644 --- a/app/src/main/java/com/keylesspalace/tusky/appstore/Events.kt +++ b/app/src/main/java/com/keylesspalace/tusky/appstore/Events.kt @@ -9,6 +9,7 @@ data class FavoriteEvent(val statusId: String, val favourite: Boolean) : Dispatc data class ReblogEvent(val statusId: String, val reblog: Boolean) : Dispatchable data class BookmarkEvent(val statusId: String, val bookmark: Boolean) : Dispatchable data class MuteStatusEvent(val statusId: String, val mute: Boolean) : Dispatchable +data class EmojiReactEvent(val statusId: String, val reacted: Boolean, val emoji: String) : Dispatchable data class UnfollowEvent(val accountId: String) : Dispatchable data class BlockEvent(val accountId: String) : Dispatchable data class MuteEvent(val accountId: String) : Dispatchable diff --git a/app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt b/app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt index f4acc657..f147bbcf 100644 --- a/app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt +++ b/app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt @@ -28,8 +28,8 @@ data class Emoji( @Parcelize data class EmojiReaction( - val emoji: String, + val name: String, val count: Int, - val reacted: Boolean, + val me: Boolean, val accounts: List? // only for emoji_reactions_by ) : Parcelable diff --git a/app/src/main/java/com/keylesspalace/tusky/interfaces/StatusActionListener.java b/app/src/main/java/com/keylesspalace/tusky/interfaces/StatusActionListener.java index c04b03dc..719d20c2 100644 --- a/app/src/main/java/com/keylesspalace/tusky/interfaces/StatusActionListener.java +++ b/app/src/main/java/com/keylesspalace/tusky/interfaces/StatusActionListener.java @@ -64,5 +64,6 @@ public interface StatusActionListener extends LinkListener { void onVoteInPoll(int position, @NonNull List choices); default void onMute(int position, boolean isMuted) {} + default void onEmojiReact(final boolean react, final String emoji, final int position) {}; } diff --git a/app/src/main/java/com/keylesspalace/tusky/network/MastodonApi.kt b/app/src/main/java/com/keylesspalace/tusky/network/MastodonApi.kt index 4bf6e7d9..3a338fe2 100644 --- a/app/src/main/java/com/keylesspalace/tusky/network/MastodonApi.kt +++ b/app/src/main/java/com/keylesspalace/tusky/network/MastodonApi.kt @@ -584,20 +584,20 @@ interface MastodonApi { @GET fun getNodeinfo(@Url url: String) : Single - @POST("api/v1/pleroma/statuses/{id}/react_with_emoji") + @PUT("api/v1/pleroma/statuses/{id}/reactions/{emoji}") fun reactWithEmoji( @Path("id") statusId: String, - @Field("emoji") emoji: String + @Path("emoji") emoji: String ): Single - @POST("api/v1/pleroma/statuses/{id}/unreact_with_emoji") + @DELETE("api/v1/pleroma/statuses/{id}/reactions/{emoji}") fun unreactWithEmoji( @Path("id") statusId: String, - @Field("emoji") emoji: String + @Path("emoji") emoji: String ): Single - @GET("api/v1/pleroma/statuses/{id}/emoji_reactions_by") - fun reactWithEmoji( + @GET("api/v1/pleroma/statuses/{id}/reactions") + fun statusReactedBy( @Path("id") statusId: String - ): Single + ): Single> }