Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于ForwardMessage中Node无法定义senderName问题. #2187

Closed
xiaokun5460 opened this issue Aug 6, 2022 · 0 comments
Closed

关于ForwardMessage中Node无法定义senderName问题. #2187

xiaokun5460 opened this issue Aug 6, 2022 · 0 comments
Labels
M 优先级: 主要 s:core 子系统: mirai-core t:bug 类型: bug
Milestone

Comments

@xiaokun5460
Copy link

问题描述

构建ForwardMessage中的Node对象自定义senderName失效.传入参数无法使其生效.即:
ForwardMessage.Node node = new ForwardMessage.Node(memberId, (int) System.currentTimeMillis() / 1000, "senderName", messageChain);
其中"senderName"无法生效.2.12.1版本出现,切换老版本测试即:2.10.0,正常.

复现

private static void test(Contact contact, long memberId, List<MessageChain> list) {
        List<ForwardMessage.Node> nodes = new ArrayList<>();
        List<String> strList = new ArrayList<>(4);
        for (MessageChain messageChain : list) {
            ForwardMessage.Node node = new ForwardMessage.Node(memberId, (int) System.currentTimeMillis() / 1000, "senderName", messageChain);
            nodes.add(node);
            if (strList.size() <= 4) {
                strList.add(messageChain.contentToString());
            }
        }
        ForwardMessage forwardMessage = new ForwardMessage(strList, memberId + "的聊天记录", "[聊天记录]", "聊天记录", "查看" + list.size() + "条转发消息", nodes);
        contact.sendMessage(forwardMessage);
}

以上为测试代码,同样的代码可以切换成版本2.10.0跑即可正常.

mirai-core 版本

2.12.1

bot-protocol

ANDROID_PHONE

其他组件版本

net.mamoe mirai-core-jvm 2.12.0

系统日志

无报错.

网络日志

无报错.

补充信息

No response

@Him188 Him188 added t:bug 类型: bug M 优先级: 主要 s:core 子系统: mirai-core z:to-be-confirmed 属性:等待确认 labels Aug 26, 2022
@Him188 Him188 added this to the 2.13.0-RC milestone Aug 26, 2022
@Him188 Him188 removed the z:to-be-confirmed 属性:等待确认 label Sep 7, 2022
@Him188 Him188 closed this as completed in 951e835 Sep 7, 2022
@Him188 Him188 modified the milestones: 2.13.0-RC, 2.12.3 Sep 7, 2022
Him188 added a commit that referenced this issue Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M 优先级: 主要 s:core 子系统: mirai-core t:bug 类型: bug
Projects
None yet
Development

No branches or pull requests

2 participants