File tree Expand file tree Collapse file tree
acidify-core/src/commonMain/kotlin/org/ntqqrev/acidify Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import org.ntqqrev.acidify.common.SsoResponse
1616import org.ntqqrev.acidify.common.UnsafeAcidifyApi
1717import org.ntqqrev.acidify.entity.BotFriend
1818import org.ntqqrev.acidify.entity.BotGroup
19- import org.ntqqrev.acidify.entity.internal.CacheUtility
19+ import org.ntqqrev.acidify.entity.internal.BotEntityCache
2020import org.ntqqrev.acidify.event.AcidifyEvent
2121import org.ntqqrev.acidify.event.internal.KickSignal
2222import org.ntqqrev.acidify.event.internal.MsgPushSignal
@@ -46,12 +46,12 @@ sealed class AbstractBot(
4646 ).associateBy { it.cmd }
4747 internal lateinit var faceDetailMapMut: Map <String , BotFaceDetail >
4848 internal var eventCollectJob: Job ? = null
49- internal val friendCache = CacheUtility (
49+ internal val friendCache = BotEntityCache (
5050 bot = this ,
5151 updateCache = { bot -> bot.fetchFriends().associateBy { it.uin } },
5252 entityFactory = ::BotFriend
5353 )
54- internal val groupCache = CacheUtility (
54+ internal val groupCache = BotEntityCache (
5555 bot = this ,
5656 updateCache = { bot -> bot.fetchGroups().associateBy { it.uin } },
5757 entityFactory = ::BotGroup
Original file line number Diff line number Diff line change 11package org.ntqqrev.acidify.entity
22
33import org.ntqqrev.acidify.AbstractBot
4- import org.ntqqrev.acidify.entity.internal.CacheUtility
4+ import org.ntqqrev.acidify.entity.internal.BotEntityCache
55import org.ntqqrev.acidify.fetchGroupMembers
66import org.ntqqrev.acidify.struct.BotGroupData
77import org.ntqqrev.acidify.struct.GroupMemberRole
@@ -15,7 +15,7 @@ class BotGroup internal constructor(
1515 bot : AbstractBot ,
1616 data : BotGroupData ,
1717) : BotEntity<BotGroupData>(bot, data) {
18- private val memberCache = CacheUtility (
18+ private val memberCache = BotEntityCache (
1919 bot = bot,
2020 updateCache = { bot -> bot.fetchGroupMembers(uin).associateBy { it.uin } },
2121 entityFactory = { bot, data ->
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import kotlinx.coroutines.sync.withLock
66import org.ntqqrev.acidify.AbstractBot
77import org.ntqqrev.acidify.entity.BotEntity
88
9- internal class CacheUtility <K , V : BotEntity <D >, D >(
9+ internal class BotEntityCache <K , V : BotEntity <D >, D >(
1010 val bot : AbstractBot ,
1111 private val updateCache : suspend (bot: AbstractBot ) -> Map <K , D >,
1212 private val entityFactory : (bot: AbstractBot , data: D ) -> V ,
You can’t perform that action at this time.
0 commit comments