mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 02:20:14 +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
|
* 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
|
package net.mamoe.mirai.qqandroid.contact
|
||||||
|
|
||||||
@ -206,7 +206,7 @@ internal class MemberImpl constructor(
|
|||||||
message = message
|
message = message
|
||||||
).sendAndExpect()
|
).sendAndExpect()
|
||||||
|
|
||||||
check(response.success) { "kick failed: $message" }
|
check(response.success) { "kick failed: ${response.ret}" }
|
||||||
|
|
||||||
MemberLeaveEvent.Kick(this@MemberImpl, null).broadcast()
|
MemberLeaveEvent.Kick(this@MemberImpl, null).broadcast()
|
||||||
}
|
}
|
||||||
|
@ -146,14 +146,17 @@ internal class TroopManagement {
|
|||||||
|
|
||||||
internal object Kick : OutgoingPacketFactory<Kick.Response>("OidbSvc.0x8a0_0") {
|
internal object Kick : OutgoingPacketFactory<Kick.Response>("OidbSvc.0x8a0_0") {
|
||||||
override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): Response {
|
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(
|
return Response(
|
||||||
this.readBytes()
|
ret == 0,
|
||||||
.loadAs(OidbSso.OIDBSSOPkg.serializer()).bodybuffer.loadAs(Oidb0x8a0.RspBody.serializer()).msgKickResult!![0].optUint32Result == 1
|
ret
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
class Response(
|
class Response(
|
||||||
val success: Boolean
|
val success: Boolean,
|
||||||
|
val ret: Int
|
||||||
) : Packet {
|
) : Packet {
|
||||||
override fun toString(): String = "TroopManagement.Kick.Response($success)"
|
override fun toString(): String = "TroopManagement.Kick.Response($success)"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user