diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 8203dbef2..8c6092dfe 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -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 diff --git a/mirai-core/src/commonMain/kotlin/utils/RemoteFileImpl.kt b/mirai-core/src/commonMain/kotlin/utils/RemoteFileImpl.kt index 265cce8dc..eb4e7f0d4 100644 --- a/mirai-core/src/commonMain/kotlin/utils/RemoteFileImpl.kt +++ b/mirai-core/src/commonMain/kotlin/utils/RemoteFileImpl.kt @@ -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 { + private suspend fun getFilesFlow(): Flow { + 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