mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-08 22:09:50 +08:00
Fix friend message history syncing
This commit is contained in:
parent
87e76d4890
commit
741d8f9eca
@ -412,8 +412,8 @@ internal class QQAndroidBotNetworkHandler(coroutineContext: CoroutineContext, bo
|
||||
withTimeoutOrNull(30000) {
|
||||
launch(CoroutineName("Syncing friend message history")) { syncFromEvent<MessageSvcPbGetMsg.GetMsgSuccess, Unit> { Unit } }
|
||||
// 别问我为什么要发两个 我也不知道 反正它能用
|
||||
MessageSvcPbGetMsg(bot.client, MsgSvc.SyncFlag.START, currentTimeSeconds, null,firstSync = true).sendAndExpect<Packet>()
|
||||
MessageSvcPbGetMsg(bot.client, MsgSvc.SyncFlag.START, currentTimeSeconds, null,firstSync = true).sendAndExpect<Packet>()
|
||||
MessageSvcPbGetMsg(bot.client, MsgSvc.SyncFlag.START, null, firstSync = true).sendAndExpect<Packet>()
|
||||
MessageSvcPbGetMsg(bot.client, MsgSvc.SyncFlag.START, null, firstSync = true).sendAndExpect<Packet>()
|
||||
} ?: error("timeout syncing friend message history")
|
||||
logger.info { "Syncing friend message history: Success" }
|
||||
}
|
||||
|
@ -128,6 +128,8 @@ internal open class QQAndroidClient(
|
||||
|
||||
lateinit var fileStoragePushFSSvcList: FileStoragePushFSSvcListFuckKotlin
|
||||
|
||||
internal val firstSyncPackets: AtomicInt = atomic(0) // 启动时候仅将所有好友信息设为已读的包
|
||||
|
||||
internal suspend inline fun useNextServers(crossinline block: suspend (host: String, port: Int) -> Unit) {
|
||||
if (bot.client.serverList.isEmpty()) {
|
||||
throw NoServerAvailableException(null)
|
||||
|
Loading…
Reference in New Issue
Block a user