mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
Shamrock
: 雑談ニックネームの紛失を修正する
Signed-off-by: WhiteChi <whitechi73@outlook.com>
This commit is contained in:
parent
e162da7e7b
commit
f17b4924c9
@ -5,6 +5,7 @@ import com.tencent.qqnt.kernel.nativeinterface.MsgRecord
|
|||||||
import kotlinx.coroutines.flow.FlowCollector
|
import kotlinx.coroutines.flow.FlowCollector
|
||||||
import kotlinx.coroutines.flow.MutableSharedFlow
|
import kotlinx.coroutines.flow.MutableSharedFlow
|
||||||
import moe.fuqiuluo.qqinterface.servlet.BaseSvc
|
import moe.fuqiuluo.qqinterface.servlet.BaseSvc
|
||||||
|
import moe.fuqiuluo.qqinterface.servlet.CardSvc
|
||||||
import moe.fuqiuluo.qqinterface.servlet.GroupSvc
|
import moe.fuqiuluo.qqinterface.servlet.GroupSvc
|
||||||
import moe.fuqiuluo.qqinterface.servlet.msg.convert.toSegments
|
import moe.fuqiuluo.qqinterface.servlet.msg.convert.toSegments
|
||||||
import moe.fuqiuluo.shamrock.remote.service.config.ShamrockConfig
|
import moe.fuqiuluo.shamrock.remote.service.config.ShamrockConfig
|
||||||
@ -96,17 +97,23 @@ internal object GlobalEventTransmitter: BaseSvc() {
|
|||||||
postType: PostType = PostType.Msg,
|
postType: PostType = PostType.Msg,
|
||||||
tempSource: MessageTempSource = MessageTempSource.Unknown
|
tempSource: MessageTempSource = MessageTempSource.Unknown
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val uin = app.longAccountUin
|
val botUin = app.longAccountUin
|
||||||
|
var nickName = record.sendNickName
|
||||||
|
if (nickName.isNullOrBlank()) {
|
||||||
|
CardSvc.getProfileCard(record.senderUin.toString()).onSuccess {
|
||||||
|
nickName = it.strNick ?: ""
|
||||||
|
}
|
||||||
|
}
|
||||||
transMessageEvent(record,
|
transMessageEvent(record,
|
||||||
MessageEvent(
|
MessageEvent(
|
||||||
time = record.msgTime,
|
time = record.msgTime,
|
||||||
selfId = uin,
|
selfId = botUin,
|
||||||
postType = postType,
|
postType = postType,
|
||||||
messageType = MsgType.Private,
|
messageType = MsgType.Private,
|
||||||
subType = MsgSubType.Friend,
|
subType = MsgSubType.Friend,
|
||||||
messageId = msgHash,
|
messageId = msgHash,
|
||||||
targetId = record.peerUin,
|
targetId = record.peerUin,
|
||||||
peerId = uin,
|
peerId = botUin,
|
||||||
userId = record.senderUin,
|
userId = record.senderUin,
|
||||||
message = if(ShamrockConfig.useCQ()) rawMsg.json
|
message = if(ShamrockConfig.useCQ()) rawMsg.json
|
||||||
else elements.toSegments(record.chatType, record.peerUin.toString()).map {
|
else elements.toSegments(record.chatType, record.peerUin.toString()).map {
|
||||||
@ -116,7 +123,7 @@ internal object GlobalEventTransmitter: BaseSvc() {
|
|||||||
font = 0,
|
font = 0,
|
||||||
sender = Sender(
|
sender = Sender(
|
||||||
userId = record.senderUin,
|
userId = record.senderUin,
|
||||||
nickname = record.sendNickName,
|
nickname = nickName,
|
||||||
card = record.sendMemberName,
|
card = record.sendMemberName,
|
||||||
role = MemberRole.Member,
|
role = MemberRole.Member,
|
||||||
title = "",
|
title = "",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user