emojireactions: add entities and api endpoints

main
Alibek Omarov 5 years ago
parent c1474e82a8
commit 2f818a77f3
  1. 8
      app/src/main/java/com/keylesspalace/tusky/entity/Emoji.kt
  2. 3
      app/src/main/java/com/keylesspalace/tusky/entity/Status.kt
  3. 17
      app/src/main/java/com/keylesspalace/tusky/network/MastodonApi.kt

@ -25,3 +25,11 @@ data class Emoji(
val url: String, val url: String,
@SerializedName("visible_in_picker") val visibleInPicker: Boolean? @SerializedName("visible_in_picker") val visibleInPicker: Boolean?
) : Parcelable ) : Parcelable
@Parcelize
data class EmojiReaction(
val emoji: String,
val count: Int,
val reacted: Boolean,
val accounts: List<Account>? // only for emoji_reactions_by
) : Parcelable

@ -173,7 +173,8 @@ data class Status(
data class PleromaStatus( data class PleromaStatus(
@SerializedName("thread_muted") var threadMuted: Boolean?, @SerializedName("thread_muted") var threadMuted: Boolean?,
@SerializedName("conversation_id") val conversationId: Int? @SerializedName("conversation_id") val conversationId: Int?,
@SerializedName("emoji_reactions") val emojiReactions: List<EmojiReaction>?
) )
data class Mention ( data class Mention (

@ -583,4 +583,21 @@ interface MastodonApi {
@GET @GET
fun getNodeinfo(@Url url: String) : Single<NodeInfo> fun getNodeinfo(@Url url: String) : Single<NodeInfo>
@POST("api/v1/pleroma/statuses/{id}/react_with_emoji")
fun reactWithEmoji(
@Path("id") statusId: String,
@Field("emoji") emoji: String
): Single<Status>
@POST("api/v1/pleroma/statuses/{id}/unreact_with_emoji")
fun unreactWithEmoji(
@Path("id") statusId: String,
@Field("emoji") emoji: String
): Single<Status>
@GET("api/v1/pleroma/statuses/{id}/emoji_reactions_by")
fun reactWithEmoji(
@Path("id") statusId: String
): Single<Status>
} }

Loading…
Cancel
Save