Commit 01d16253 authored by ryoii's avatar ryoii

Fix a possible bug

parent 5635509c
......@@ -136,7 +136,8 @@ internal class NewContact {
return if (struct == null) null else {
struct.msg?.run<Structmsg.SystemMsg, Packet> {
if (c2cInviteJoinGroupFlag == 1) {
when (c2cInviteJoinGroupFlag) {
1 -> {
// 被邀请入群
BotInvitedJoinGroupRequestEvent(
bot,
......@@ -146,7 +147,8 @@ internal class NewContact {
groupName,
actionUinNick
)
} else {
}
0 -> {
// 成员申请入群
MemberJoinRequestEvent(
bot,
......@@ -158,6 +160,8 @@ internal class NewContact {
reqUinNick
)
}
else -> throw IllegalStateException("Unknown c2cInviteJoinGroupFlag: $c2cInviteJoinGroupFlag in SystemMsgNewGroup packet")
}
} as Packet // 没有 as Packet 垃圾 kotlin 会把类型推断为Any
}
}
......
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