mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-09 18:00:33 +08:00
Fix kick
This commit is contained in:
parent
8f4313a337
commit
ee89f22c87
@ -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()
|
||||
}
|
||||
|
@ -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)"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user