Fix missing chats in app
Signed-off-by: Adolfo Santiago <epoch@nixnetmail.com>
This commit is contained in:
parent
9bc7e522a6
commit
237241baa1
2 changed files with 13 additions and 13 deletions
|
@ -631,7 +631,7 @@ interface MastodonApi {
|
||||||
@Path("message_id") messageId: String
|
@Path("message_id") messageId: String
|
||||||
): Single<ChatMessage>
|
): Single<ChatMessage>
|
||||||
|
|
||||||
@GET("api/v1/pleroma/chats")
|
@GET("api/v2/pleroma/chats")
|
||||||
fun getChats(
|
fun getChats(
|
||||||
@Query("max_id") maxId: String?,
|
@Query("max_id") maxId: String?,
|
||||||
@Query("min_id") minId: String?,
|
@Query("min_id") minId: String?,
|
||||||
|
|
|
@ -59,14 +59,14 @@ class ChatRepositoryImpl(
|
||||||
getChatMessagesFromNetwork(chatId, maxId, sinceId, sincedIdMinusOne, limit, accountId, requestMode)
|
getChatMessagesFromNetwork(chatId, maxId, sinceId, sincedIdMinusOne, limit, accountId, requestMode)
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
return getChatMessagesFromNetwork(chatId, maxId, sinceId, sincedIdMinusOne, limit, accountId, requestMode)
|
return getChatMessagesFromNetwork(chatId, maxId, null, null, limit, accountId, requestMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getChatsFromNetwork(maxId: String?, sinceId: String?,
|
private fun getChatsFromNetwork(maxId: String?, sinceId: String?,
|
||||||
sinceIdMinusOne: String?, limit: Int,
|
sinceIdMinusOne: String?, limit: Int,
|
||||||
accountId: Long, requestMode: TimelineRequestMode
|
accountId: Long, requestMode: TimelineRequestMode
|
||||||
): Single<out List<ChatStatus>> {
|
): Single<out List<ChatStatus>> {
|
||||||
return mastodonApi.getChats(maxId, null, sinceIdMinusOne, 0, limit + 1)
|
return mastodonApi.getChats(null, null, sinceIdMinusOne, 0, limit + 1)
|
||||||
.map { chats ->
|
.map { chats ->
|
||||||
this.saveChatsToDb(accountId, chats, maxId, sinceId)
|
this.saveChatsToDb(accountId, chats, maxId, sinceId)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue