Don't add new friend when reject new friend request

This commit is contained in:
Karlatemp 2021-02-15 13:43:03 +08:00
parent e7e8d8ca6a
commit addee38c70
No known key found for this signature in database
GPG Key ID: 21FBDDF664FF06F8

View File

@ -20,7 +20,6 @@ import kotlinx.coroutines.withContext
import kotlinx.io.core.discardExact
import kotlinx.io.core.readBytes
import kotlinx.serialization.json.*
import net.mamoe.kjbb.JvmBlockingBridge
import net.mamoe.mirai.*
import net.mamoe.mirai.contact.*
import net.mamoe.mirai.data.*
@ -794,6 +793,9 @@ internal open class MiraiImpl : IMirai, LowLevelApiAccessor {
accept = accept,
blackList = blackList
).sendWithoutExpect()
if (!accept) return@apply
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
bot.friends.delegate.add(newFriend(bot, FriendInfoImpl(fromId, fromNick, "")))
}