emojireactions: fix EmojiReaction object

This commit is contained in:
Alibek Omarov 2020-02-19 04:18:21 +03:00
parent 489c81a12a
commit 82c6809623
4 changed files with 11 additions and 9 deletions

View File

@ -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

View File

@ -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<Account>? // only for emoji_reactions_by
) : Parcelable

View File

@ -64,5 +64,6 @@ public interface StatusActionListener extends LinkListener {
void onVoteInPoll(int position, @NonNull List<Integer> choices);
default void onMute(int position, boolean isMuted) {}
default void onEmojiReact(final boolean react, final String emoji, final int position) {};
}

View File

@ -584,20 +584,20 @@ interface MastodonApi {
@GET
fun getNodeinfo(@Url url: String) : Single<NodeInfo>
@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<Status>
@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<Status>
@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<Status>
): Single<List<EmojiReaction>>
}