mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-22 22:01:00 +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,
|
accept = true,
|
||||||
blackList = false
|
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")
|
@Suppress("DuplicatedCode")
|
||||||
@ -849,20 +841,7 @@ internal open class MiraiImpl : IMirai, LowLevelApiAccessor {
|
|||||||
message = message
|
message = message
|
||||||
).sendWithoutExpect()
|
).sendWithoutExpect()
|
||||||
}
|
}
|
||||||
|
// Add member in MsgOnlinePush.PbPushMsg
|
||||||
if (accept ?: return@run)
|
|
||||||
groups[groupId]?.run {
|
|
||||||
members.delegate.add(
|
|
||||||
newMember(
|
|
||||||
MemberInfoImpl(
|
|
||||||
uin = fromId,
|
|
||||||
nick = fromNick,
|
|
||||||
permission = MemberPermission.MEMBER,
|
|
||||||
"", "", "", 0, null
|
|
||||||
)
|
|
||||||
).cast()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalStdlibApi::class)
|
@OptIn(ExperimentalStdlibApi::class)
|
||||||
|
Loading…
Reference in New Issue
Block a user