Skip to content

Commit

Permalink
EventManager: fix BotJoinGroupEvent threads
Browse files Browse the repository at this point in the history
  • Loading branch information
PeratX committed Sep 9, 2020
1 parent 6a9a315 commit df38050
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions src/main/kotlin/org/itxtech/mirainative/manager/EventManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -129,23 +129,27 @@ object EventManager {
)
}
}
subscribeAlways<BotJoinGroupEvent.Invite> { ev ->
NativeBridge.eventGroupMemberJoin(
Bridge.MEMBER_JOIN_INVITED_BY_ADMIN,
getTimestamp(),
group.id,
ev.invitor.id,
bot.id
)
subscribeAlways<BotJoinGroupEvent.Invite> {
launchEvent {
NativeBridge.eventGroupMemberJoin(
Bridge.MEMBER_JOIN_INVITED_BY_ADMIN,
getTimestamp(),
group.id,
invitor.id,
bot.id
)
}
}
subscribeAlways<BotJoinGroupEvent.Active> {
NativeBridge.eventGroupMemberJoin(
Bridge.MEMBER_JOIN_INVITED_BY_ADMIN,
getTimestamp(),
group.id,
0,
bot.id
)
launchEvent {
NativeBridge.eventGroupMemberJoin(
Bridge.MEMBER_JOIN_INVITED_BY_ADMIN,
getTimestamp(),
group.id,
0,
bot.id
)
}
}

//加好友事件
Expand Down Expand Up @@ -191,11 +195,11 @@ object EventManager {
)
}
}
subscribeAlways<BotLeaveEvent.Kick> { ev ->
subscribeAlways<BotLeaveEvent.Kick> {
launchEvent {
NativeBridge.eventGroupMemberLeave(
Bridge.MEMBER_LEAVE_KICK,
getTimestamp(), group.id, ev.operator.id, bot.id
getTimestamp(), group.id, operator.id, bot.id
)
}
}
Expand Down

0 comments on commit df38050

Please sign in to comment.