1
1
/*
2
- * Copyright 2019-2020 Mamoe Technologies and contributors.
2
+ * Copyright 2019-2021 Mamoe Technologies and contributors.
3
3
*
4
4
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
5
5
* Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link.
@@ -12,6 +12,7 @@ package net.mamoe.mirai.internal.contact
12
12
import net.mamoe.mirai.contact.MemberPermission
13
13
import net.mamoe.mirai.data.MemberInfo
14
14
import net.mamoe.mirai.internal.network.protocol.data.jce.StTroopMemberInfo
15
+ import net.mamoe.mirai.utils.currentTimeSeconds
15
16
16
17
internal class MemberInfoImpl (
17
18
override val uin : Long ,
@@ -22,6 +23,8 @@ internal class MemberInfoImpl(
22
23
override val specialTitle : String ,
23
24
override val muteTimestamp : Int ,
24
25
override val anonymousId : String? ,
26
+ override val joinTimestamp : Int = currentTimeSeconds().toInt(),
27
+ override var lastSpeakTimestamp : Int = 0
25
28
) : MemberInfo, UserInfoImpl(uin, nick, remark) {
26
29
constructor (
27
30
jceInfo: StTroopMemberInfo ,
@@ -39,5 +42,7 @@ internal class MemberInfoImpl(
39
42
specialTitle = jceInfo.sSpecialTitle.orEmpty(),
40
43
muteTimestamp = jceInfo.dwShutupTimestap?.toInt() ? : 0 ,
41
44
anonymousId = null ,
45
+ joinTimestamp = jceInfo.dwJoinTime?.toInt() ? : 0 ,
46
+ lastSpeakTimestamp = jceInfo.dwLastSpeakTime?.toInt() ? : 0
42
47
)
43
48
}
0 commit comments