mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-22 13:46:13 +08:00
Fix duplicated MemberJoinEvent broadcast; fix #1090
This commit is contained in:
parent
27e0f572d3
commit
d4532f948c
@ -195,14 +195,6 @@ internal open class MiraiImpl : IMirai, LowLevelApiAccessor {
|
||||
accept = true,
|
||||
blackList = false
|
||||
)
|
||||
|
||||
event.group?.getMember(event.fromId)?.let { member ->
|
||||
if (event.invitor != null) {
|
||||
MemberJoinEvent.Invite(member, event.invitor!!)
|
||||
} else {
|
||||
MemberJoinEvent.Active(member)
|
||||
}.broadcastWithBot(event.bot)
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("DuplicatedCode")
|
||||
@ -849,20 +841,7 @@ internal open class MiraiImpl : IMirai, LowLevelApiAccessor {
|
||||
message = message
|
||||
).sendWithoutExpect()
|
||||
}
|
||||
|
||||
if (accept ?: return@run)
|
||||
groups[groupId]?.run {
|
||||
members.delegate.add(
|
||||
newMember(
|
||||
MemberInfoImpl(
|
||||
uin = fromId,
|
||||
nick = fromNick,
|
||||
permission = MemberPermission.MEMBER,
|
||||
"", "", "", 0, null
|
||||
)
|
||||
).cast()
|
||||
)
|
||||
}
|
||||
// Add member in MsgOnlinePush.PbPushMsg
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalStdlibApi::class)
|
||||
|
Loading…
Reference in New Issue
Block a user