diff --git a/README.md b/README.md index 86747d56c..84406a67c 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ mirai 是一个在全平台下运行,提供 QQ Android 协议支持的高效 - 闪照 - 撤回群员消息 - 自定义消息 +- 音乐分享 **群相关** - 群列表 diff --git a/mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt b/mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt index e10c2c697..6357c4ffa 100644 --- a/mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt +++ b/mirai-core/src/commonMain/kotlin/contact/SendMessageHandler.kt @@ -65,6 +65,13 @@ internal abstract class SendMessageHandler { groupCard = senderName // Cinnamon ) else null + // For ForwardMessage display + val ForwardMessage.INode.groupInfo: MsgComm.GroupInfo + get() = MsgComm.GroupInfo( + groupCode = if (isToGroup) targetGroupCode!! else 0, + groupCard = senderName + ) + val isToGroup: Boolean get() = contact is Group suspend fun MessageChain.convertToLongMessageIfNeeded( diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/MultiMsg.kt b/mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/MultiMsg.kt index 4f9012a48..921f95ba4 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/MultiMsg.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/MultiMsg.kt @@ -62,7 +62,7 @@ internal fun Collection.calculateValidationData( msgId = 1 ), msgType = 82, // troop - groupInfo = handler.groupInfo, + groupInfo = handler.run { chain.groupInfo }, isSrcMsg = false ), msgBody = ImMsgBody.MsgBody(