ChatRepository: Bump up sync limit a bit
This commit is contained in:
@@ -92,6 +92,6 @@ class MessageListViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun synchronize() = viewModelScope.launch {
|
fun synchronize() = viewModelScope.launch {
|
||||||
repository.synchronizeConversation(conversation!!)
|
repository.synchronizeConversation(conversation!!, limit = 100)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -173,10 +173,10 @@ class ChatRepository(
|
|||||||
_errorEncounteredChannel.emit(Error.ConnectionError(e))
|
_errorEncounteredChannel.emit(Error.ConnectionError(e))
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun synchronizeConversation(conversation: Conversation) = try {
|
suspend fun synchronizeConversation(conversation: Conversation, limit: Int = 15) = try {
|
||||||
// TODO: Should only fetch messages after the last GUID we know about.
|
// TODO: Should only fetch messages after the last GUID we know about.
|
||||||
// But keep in mind that outgoing message GUIDs are fake...
|
// But keep in mind that outgoing message GUIDs are fake...
|
||||||
val messages = fetchMessages(conversation, limit = 15)
|
val messages = fetchMessages(conversation, limit = limit)
|
||||||
database.writeMessages(messages, conversation)
|
database.writeMessages(messages, conversation)
|
||||||
} catch (e: java.lang.Exception) {
|
} catch (e: java.lang.Exception) {
|
||||||
_errorEncounteredChannel.emit(Error.ConnectionError(e))
|
_errorEncounteredChannel.emit(Error.ConnectionError(e))
|
||||||
|
|||||||
Reference in New Issue
Block a user