This commit is contained in:
Him188 2020-04-09 15:56:45 +08:00
parent 8f4313a337
commit ee89f22c87
2 changed files with 8 additions and 5 deletions

View File

@ -7,7 +7,7 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
@file:Suppress("EXPERIMENTAL_API_USAGE")
@file:Suppress("EXPERIMENTAL_API_USAGE", "DEPRECATION_ERROR")
package net.mamoe.mirai.qqandroid.contact
@ -206,7 +206,7 @@ internal class MemberImpl constructor(
message = message
).sendAndExpect()
check(response.success) { "kick failed: $message" }
check(response.success) { "kick failed: ${response.ret}" }
MemberLeaveEvent.Kick(this@MemberImpl, null).broadcast()
}

View File

@ -146,14 +146,17 @@ internal class TroopManagement {
internal object Kick : OutgoingPacketFactory<Kick.Response>("OidbSvc.0x8a0_0") {
override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): Response {
val ret = this.readBytes()
.loadAs(OidbSso.OIDBSSOPkg.serializer()).bodybuffer.loadAs(Oidb0x8a0.RspBody.serializer()).msgKickResult!![0].optUint32Result
return Response(
this.readBytes()
.loadAs(OidbSso.OIDBSSOPkg.serializer()).bodybuffer.loadAs(Oidb0x8a0.RspBody.serializer()).msgKickResult!![0].optUint32Result == 1
ret == 0,
ret
)
}
class Response(
val success: Boolean
val success: Boolean,
val ret: Int
) : Packet {
override fun toString(): String = "TroopManagement.Kick.Response($success)"
}