mirror of
https://github.com/mamoe/mirai.git
synced 2024-12-31 04:44:41 +08:00
Add MessageSource.time
This commit is contained in:
parent
f5a6040668
commit
3d4ff807af
@ -21,6 +21,7 @@ import net.mamoe.mirai.qqandroid.network.protocol.data.proto.SourceMsg
|
|||||||
internal inline class MessageSourceFromServer(
|
internal inline class MessageSourceFromServer(
|
||||||
val delegate: ImMsgBody.SourceMsg
|
val delegate: ImMsgBody.SourceMsg
|
||||||
) : MessageSource {
|
) : MessageSource {
|
||||||
|
override val time: Long get() = delegate.time.toLong() and 0xFFFFFFFF
|
||||||
override val messageUid: Long get() = delegate.pbReserve.loadAs(SourceMsg.ResvAttr.serializer()).origUids!!
|
override val messageUid: Long get() = delegate.pbReserve.loadAs(SourceMsg.ResvAttr.serializer()).origUids!!
|
||||||
override val sourceMessage: MessageChain get() = delegate.toMessageChain()
|
override val sourceMessage: MessageChain get() = delegate.toMessageChain()
|
||||||
override val senderId: Long get() = delegate.senderUin
|
override val senderId: Long get() = delegate.senderUin
|
||||||
@ -32,6 +33,7 @@ internal inline class MessageSourceFromServer(
|
|||||||
internal inline class MessageSourceFromMsg(
|
internal inline class MessageSourceFromMsg(
|
||||||
val delegate: MsgComm.Msg
|
val delegate: MsgComm.Msg
|
||||||
) : MessageSource {
|
) : MessageSource {
|
||||||
|
override val time: Long get() = delegate.msgHead.msgTime.toLong() and 0xFFFFFFFF
|
||||||
override val messageUid: Long get() = delegate.msgBody.richText.attr!!.random.toLong()
|
override val messageUid: Long get() = delegate.msgBody.richText.attr!!.random.toLong()
|
||||||
override val sourceMessage: MessageChain get() = delegate.toMessageChain()
|
override val sourceMessage: MessageChain get() = delegate.toMessageChain()
|
||||||
override val senderId: Long get() = delegate.msgHead.fromUin
|
override val senderId: Long get() = delegate.msgHead.fromUin
|
||||||
|
@ -31,6 +31,11 @@ interface MessageSource : Message {
|
|||||||
*/
|
*/
|
||||||
val messageUid: Long
|
val messageUid: Long
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送时间, 单位为秒
|
||||||
|
*/
|
||||||
|
val time: Long
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送人号码
|
* 发送人号码
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user