mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-24 02:40:13 +08:00
Fix empty listFiles for child directories, fix #1118
This commit is contained in:
parent
24587503a3
commit
174ca300d6
@ -91,7 +91,7 @@ internal class RemoteFileInfo(
|
|||||||
) {
|
) {
|
||||||
companion object {
|
companion object {
|
||||||
val root = RemoteFileInfo(
|
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 {
|
return flow {
|
||||||
var index = 0
|
var index = 0
|
||||||
while (true) {
|
while (true) {
|
||||||
val list = FileManagement.GetFileList(
|
val list = FileManagement.GetFileList(
|
||||||
client,
|
client,
|
||||||
groupCode = contact.id,
|
groupCode = contact.id,
|
||||||
folderId = path,
|
folderId = info.id,
|
||||||
startIndex = index
|
startIndex = index
|
||||||
).sendAndExpect(bot).toResult("RemoteFile.listFiles").getOrThrow()
|
).sendAndExpect(bot).toResult("RemoteFile.listFiles").getOrThrow()
|
||||||
index += list.itemList.size
|
index += list.itemList.size
|
||||||
|
Loading…
Reference in New Issue
Block a user