Commit 095feaf5 authored by Him188's avatar Him188

Fix #106

parent b9d5fa4c
...@@ -36,6 +36,8 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.MessageSvc ...@@ -36,6 +36,8 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.MessageSvc
import net.mamoe.mirai.qqandroid.utils.toIpV4AddressString import net.mamoe.mirai.qqandroid.utils.toIpV4AddressString
import net.mamoe.mirai.utils.* import net.mamoe.mirai.utils.*
import net.mamoe.mirai.utils.io.toUHexString import net.mamoe.mirai.utils.io.toUHexString
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
import kotlin.coroutines.CoroutineContext import kotlin.coroutines.CoroutineContext
import net.mamoe.mirai.qqandroid.network.protocol.data.jce.FriendInfo as JceFriendInfo import net.mamoe.mirai.qqandroid.network.protocol.data.jce.FriendInfo as JceFriendInfo
...@@ -356,10 +358,14 @@ internal class MemberInfoImpl( ...@@ -356,10 +358,14 @@ internal class MemberInfoImpl(
override val muteTimestamp: Int = jceInfo.dwShutupTimestap?.toInt() ?: 0 override val muteTimestamp: Int = jceInfo.dwShutupTimestap?.toInt() ?: 0
} }
/** @OptIn(ExperimentalContracts::class)
* 对GroupImpl internal fun GroupImpl.Companion.checkIsInstance(expression: Boolean) {
* 中name/announcement的更改会直接向服务器异步汇报 contract {
*/ returns() implies expression
}
check(expression) { "group is not an instanceof GroupImpl!! DO NOT interlace two or more protocol implementations!!" }
}
@Suppress("PropertyName") @Suppress("PropertyName")
@OptIn(MiraiInternalAPI::class) @OptIn(MiraiInternalAPI::class)
internal class GroupImpl( internal class GroupImpl(
...@@ -368,6 +374,10 @@ internal class GroupImpl( ...@@ -368,6 +374,10 @@ internal class GroupImpl(
groupInfo: GroupInfo, groupInfo: GroupInfo,
members: Sequence<MemberInfo> members: Sequence<MemberInfo>
) : Group() { ) : Group() {
companion object {
}
override val bot: QQAndroidBot by bot.unsafeWeakRef() override val bot: QQAndroidBot by bot.unsafeWeakRef()
val uin: Long = groupInfo.uin val uin: Long = groupInfo.uin
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment