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 baee54bc..f4acc657 100644 --- a/app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt +++ b/app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt @@ -24,4 +24,12 @@ data class Emoji( val shortcode: String, val url: String, @SerializedName("visible_in_picker") val visibleInPicker: Boolean? -) : Parcelable \ No newline at end of file +) : Parcelable + +@Parcelize +data class EmojiReaction( + val emoji: String, + val count: Int, + val reacted: Boolean, + val accounts: List? // only for emoji_reactions_by +) : Parcelable diff --git a/app/src/main/java/com/keylesspalace/tusky/entity/Status.kt b/app/src/main/java/com/keylesspalace/tusky/entity/Status.kt index 4f6f22c8..7fc10a8f 100644 --- a/app/src/main/java/com/keylesspalace/tusky/entity/Status.kt +++ b/app/src/main/java/com/keylesspalace/tusky/entity/Status.kt @@ -173,7 +173,8 @@ data class Status( data class PleromaStatus( @SerializedName("thread_muted") var threadMuted: Boolean?, - @SerializedName("conversation_id") val conversationId: Int? + @SerializedName("conversation_id") val conversationId: Int?, + @SerializedName("emoji_reactions") val emojiReactions: List? ) data class Mention ( 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 2dacaec9..4bf6e7d9 100644 --- a/app/src/main/java/com/keylesspalace/tusky/network/MastodonApi.kt +++ b/app/src/main/java/com/keylesspalace/tusky/network/MastodonApi.kt @@ -583,4 +583,21 @@ interface MastodonApi { @GET fun getNodeinfo(@Url url: String) : Single + + @POST("api/v1/pleroma/statuses/{id}/react_with_emoji") + fun reactWithEmoji( + @Path("id") statusId: String, + @Field("emoji") emoji: String + ): Single + + @POST("api/v1/pleroma/statuses/{id}/unreact_with_emoji") + fun unreactWithEmoji( + @Path("id") statusId: String, + @Field("emoji") emoji: String + ): Single + + @GET("api/v1/pleroma/statuses/{id}/emoji_reactions_by") + fun reactWithEmoji( + @Path("id") statusId: String + ): Single }