Commit 741d8f9e authored by Him188's avatar Him188

Fix friend message history syncing

parent 87e76d48
...@@ -412,8 +412,8 @@ internal class QQAndroidBotNetworkHandler(coroutineContext: CoroutineContext, bo ...@@ -412,8 +412,8 @@ internal class QQAndroidBotNetworkHandler(coroutineContext: CoroutineContext, bo
withTimeoutOrNull(30000) { withTimeoutOrNull(30000) {
launch(CoroutineName("Syncing friend message history")) { syncFromEvent<MessageSvcPbGetMsg.GetMsgSuccess, Unit> { Unit } } 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, 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>()
} ?: error("timeout syncing friend message history") } ?: error("timeout syncing friend message history")
logger.info { "Syncing friend message history: Success" } logger.info { "Syncing friend message history: Success" }
} }
......
...@@ -128,6 +128,8 @@ internal open class QQAndroidClient( ...@@ -128,6 +128,8 @@ internal open class QQAndroidClient(
lateinit var fileStoragePushFSSvcList: FileStoragePushFSSvcListFuckKotlin lateinit var fileStoragePushFSSvcList: FileStoragePushFSSvcListFuckKotlin
internal val firstSyncPackets: AtomicInt = atomic(0) // 启动时候仅将所有好友信息设为已读的包
internal suspend inline fun useNextServers(crossinline block: suspend (host: String, port: Int) -> Unit) { internal suspend inline fun useNextServers(crossinline block: suspend (host: String, port: Int) -> Unit) {
if (bot.client.serverList.isEmpty()) { if (bot.client.serverList.isEmpty()) {
throw NoServerAvailableException(null) throw NoServerAvailableException(null)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment