Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RadiationX/ae853d6b3eed0be83d42a02434458a6f to your computer and use it in GitHub Desktop.
Save RadiationX/ae853d6b3eed0be83d42a02434458a6f to your computer and use it in GitHub Desktop.
class ChatResponse(
@SerializedName("chatId") val id: Long, // Очевидно
@SerializedName("count") val count: Int?, // Тоже в принципе
@SerializedName("lastMessage") val lastMessage: ChatMessageResponse?, // Последнее сообщение, используется в СПИСКЕ чатов. null в чате
@SerializedName("messages") val messages: List<ChatMessageResponse>?, // Сообщения в самом чате. null в списке чатов
@SerializedName("deletedIds") var deletedIds: List<Long>?, // Массив удаленных сообщений. Составляется относительно lastsync
@SerializedName("author") var author: UserResponse? // Юзер, автор чата
)
class ChatMessageResponse(
@SerializedName("localId") val localId: Long, // Это локальный айдишник сообщения, его просто нужно прокидывать
@SerializedName("id") val id: Long, // Очевидно
@SerializedName("contentType") val contentType: String, // Тип сообщения. text/image
@SerializedName("contentText") val contentText: String?, // Очевидно
@SerializedName("attachment") val attachment: MediaResponse?, // Очевидно
@SerializedName("date") val date: Date, // Дата сообщения
@SerializedName("user") val user: UserResponse // Автор сообщения
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment