Simplify logic

This commit is contained in:
Karlatemp 2021-08-24 21:31:13 +08:00
parent b3112dada3
commit beb83885c8
No known key found for this signature in database
GPG Key ID: 21FBDDF664FF06F8

View File

@ -47,6 +47,8 @@ import net.mamoe.mirai.internal.network.protocol.packet.list.FriendList
import net.mamoe.mirai.internal.network.protocol.packet.login.StatSvc
import net.mamoe.mirai.internal.network.protocol.packet.sendAndExpect
import net.mamoe.mirai.internal.network.protocol.packet.summarycard.SummaryCard
import net.mamoe.mirai.internal.network.psKey
import net.mamoe.mirai.internal.network.sKey
import net.mamoe.mirai.internal.utils.MiraiProtocolInternal
import net.mamoe.mirai.internal.utils.crypto.TEA
import net.mamoe.mirai.internal.utils.io.serialization.loadAs
@ -579,7 +581,7 @@ internal open class MiraiImpl : IMirai, LowLevelApiAccessor {
headers {
append(
"cookie",
"uin=o${id}; skey=${client.wLoginSigInfo.sKey.data.encodeToString()}; p_uin=o${id};"
"uin=o${bot.id}; skey=${bot.sKey}; p_uin=o${bot.id};"
)
}
}
@ -602,10 +604,10 @@ internal open class MiraiImpl : IMirai, LowLevelApiAccessor {
headers {
append(
"cookie",
"uin=o${id};" +
" skey=${client.wLoginSigInfo.sKey.data.encodeToString()};" +
" p_uin=o${id};" +
" p_skey=${client.wLoginSigInfo.psKeyMap["qun.qq.com"]?.data?.encodeToString()}; "
"uin=o${bot.id};" +
" skey=${bot.sKey};" +
" p_uin=o${bot.id};" +
" p_skey=${bot.psKey("qun.qq.com")}; "
)
}
}
@ -794,7 +796,7 @@ internal open class MiraiImpl : IMirai, LowLevelApiAccessor {
headers {
append(
"cookie",
"uin=o${bot.id}; skey=${bot.client.wLoginSigInfo.sKey.data.encodeToString()};"
"uin=o${bot.id}; skey=${bot.sKey};"
)
}
}