Merge branch 'fix_1118_empty_listFiles' into dev

This commit is contained in:
Him188 2021-03-28 19:32:44 +08:00
commit de170325c9
2 changed files with 6 additions and 4 deletions

View File

@ -12,7 +12,7 @@
import org.gradle.api.attributes.Attribute
object Versions {
const val project = "2.5.0"
const val project = "2.5.1-dev-1"
const val core = project
const val console = project

View File

@ -91,7 +91,7 @@ internal class RemoteFileInfo(
) {
companion object {
val root = RemoteFileInfo(
"", false, "/", "/", "", 0, 0, 0, 0, 0, 0, EMPTY_BYTE_ARRAY, EMPTY_BYTE_ARRAY
"/", false, "/", "/", "", 0, 0, 0, 0, 0, 0, EMPTY_BYTE_ARRAY, EMPTY_BYTE_ARRAY
)
}
}
@ -211,14 +211,16 @@ internal class RemoteFileImpl(
}
}
private fun getFilesFlow(): Flow<Oidb0x6d8.GetFileListRspBody.Item> {
private suspend fun getFilesFlow(): Flow<Oidb0x6d8.GetFileListRspBody.Item> {
val info = getFileFolderInfo() ?: return emptyFlow()
return flow {
var index = 0
while (true) {
val list = FileManagement.GetFileList(
client,
groupCode = contact.id,
folderId = path,
folderId = info.id,
startIndex = index
).sendAndExpect(bot).toResult("RemoteFile.listFiles").getOrThrow()
index += list.itemList.size