emojireactions: add entities and api endpoints
Co-Authored-By: Hélène <pleroma-dev@helene.moe>
This commit is contained in:
parent
5bf9743e00
commit
1975d93e0e
|
@ -114,7 +114,8 @@ class AnnouncementsViewModel @Inject constructor(
|
|||
1,
|
||||
true,
|
||||
url,
|
||||
staticUrl
|
||||
staticUrl,
|
||||
null
|
||||
)
|
||||
}
|
||||
)
|
||||
|
|
|
@ -131,7 +131,8 @@ data class ConversationStatusEntity(
|
|||
poll = poll,
|
||||
card = null,
|
||||
language = language,
|
||||
filtered = null
|
||||
filtered = null,
|
||||
pleroma = null, // FIXME
|
||||
),
|
||||
isExpanded = expanded,
|
||||
isShowingContent = showingHiddenContent,
|
||||
|
|
|
@ -199,7 +199,8 @@ fun TimelineStatusWithAccount.toViewData(gson: Gson, isDetailed: Boolean = false
|
|||
card = card,
|
||||
repliesCount = status.repliesCount,
|
||||
language = status.language,
|
||||
filtered = status.filtered
|
||||
filtered = status.filtered,
|
||||
pleroma = null, // FIXME
|
||||
)
|
||||
}
|
||||
val status = if (reblog != null) {
|
||||
|
@ -232,7 +233,8 @@ fun TimelineStatusWithAccount.toViewData(gson: Gson, isDetailed: Boolean = false
|
|||
card = null,
|
||||
repliesCount = status.repliesCount,
|
||||
language = status.language,
|
||||
filtered = status.filtered
|
||||
filtered = status.filtered,
|
||||
pleroma = null, // FIXME
|
||||
)
|
||||
} else {
|
||||
Status(
|
||||
|
@ -264,7 +266,8 @@ fun TimelineStatusWithAccount.toViewData(gson: Gson, isDetailed: Boolean = false
|
|||
card = card,
|
||||
repliesCount = status.repliesCount,
|
||||
language = status.language,
|
||||
filtered = status.filtered
|
||||
filtered = status.filtered,
|
||||
pleroma = null, // FIXME
|
||||
)
|
||||
}
|
||||
return StatusViewData.Concrete(
|
||||
|
|
|
@ -33,4 +33,5 @@ data class EmojiReaction(
|
|||
val me: Boolean,
|
||||
val url: String?,
|
||||
@SerializedName("static_url") val staticUrl: String?,
|
||||
val accounts: List<TimelineAccount>? // only for emoji_reactions_by
|
||||
)
|
||||
|
|
|
@ -50,7 +50,8 @@ data class Status(
|
|||
val poll: Poll?,
|
||||
val card: Card?,
|
||||
val language: String?,
|
||||
val filtered: List<FilterResult>?
|
||||
val filtered: List<FilterResult>?,
|
||||
val pleroma: PleromaStatus?,
|
||||
) {
|
||||
|
||||
val actionableId: String
|
||||
|
@ -160,6 +161,10 @@ data class Status(
|
|||
return builder.toString()
|
||||
}
|
||||
|
||||
data class PleromaStatus(
|
||||
@SerializedName("emoji_reactions") val emojiReactions: List<EmojiReaction>?,
|
||||
)
|
||||
|
||||
data class Mention(
|
||||
val id: String,
|
||||
val url: String,
|
||||
|
|
|
@ -24,6 +24,7 @@ import com.keylesspalace.tusky.entity.Attachment
|
|||
import com.keylesspalace.tusky.entity.Conversation
|
||||
import com.keylesspalace.tusky.entity.DeletedStatus
|
||||
import com.keylesspalace.tusky.entity.Emoji
|
||||
import com.keylesspalace.tusky.entity.EmojiReaction
|
||||
import com.keylesspalace.tusky.entity.Filter
|
||||
import com.keylesspalace.tusky.entity.FilterKeyword
|
||||
import com.keylesspalace.tusky.entity.FilterV1
|
||||
|
@ -783,4 +784,22 @@ interface MastodonApi {
|
|||
|
||||
@GET("api/v1/trends/tags")
|
||||
suspend fun trendingTags(): NetworkResult<List<TrendingTag>>
|
||||
|
||||
@PUT("api/v1/pleroma/statuses/{id}/reactions/{emoji}")
|
||||
suspend fun reactWithEmoji(
|
||||
@Path("id") statusId: String,
|
||||
@Path("emoji") emoji: String
|
||||
): NetworkResult<Status>
|
||||
|
||||
@DELETE("api/v1/pleroma/statuses/{id}/reactions/{emoji}")
|
||||
suspend fun unreactWithEmoji(
|
||||
@Path("id") statusId: String,
|
||||
@Path("emoji") emoji: String
|
||||
): NetworkResult<Status>
|
||||
|
||||
@GET("api/v1/pleroma/statuses/{id}/reactions/{emoji}")
|
||||
suspend fun statusReactedBy(
|
||||
@Path("id") statusId: String,
|
||||
@Path("emoji") emoji: String
|
||||
): Response<List<EmojiReaction>>
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue