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

[Bug?]: 转发聊天中的rkey不正确(过期) #418

Open
4 tasks done
RikaCelery opened this issue Jun 18, 2024 · 2 comments
Open
4 tasks done

[Bug?]: 转发聊天中的rkey不正确(过期) #418

RikaCelery opened this issue Jun 18, 2024 · 2 comments
Labels
bug? Maybe it's a bug

Comments

@RikaCelery
Copy link
Contributor

请确保您已阅读以上注意事项,并勾选下方的确认框。

  • 我已经仔细阅读上述内容
  • 我已经使用 最新构建 测试过,问题依旧存在。
  • 我已经在 Issue Tracker 中找过我要提出的问题,没有找到相同问题的ISSUE。
  • 我已知晓并同意,此处仅用于汇报程序中存在的问题。若这个 Issue 是关于其他非程序本身问题,则我的 Issue 可能会被无条件自动关闭或/并锁定。(其它疑问请考虑加入TG群询问或在discussions中提问)

Lagrange项目

OneBot

所使用/依赖的Lagrange项目对应的commit

b0b53a4

运行环境

MacOS

运行架构

arm64

连接方式

None

重现步骤

又双叒来自于群友的抽象转发消息

Lagrange不会递归接受嵌套的转发消息
为了递归接收所有转发消息,我进行了以下修改
1. 修改 ResolveIncomingChain()参数Lagrange.Core/Internal/Context/Logic/Implementation/MessagingLogic.cs
使用转发消息内的uid和IsGroup好像会无法正确下载视频

private async Task ResolveIncomingChain(MessageChain chain,bool forwarding=false,string _uid="", bool isGroup=false)

2. 在 MultiMsgEntity 分支中递归调用ResolveIncomingChain()

case MultiMsgEntity { ResId: not null } multi:
    {
        var @event = MultiMsgDownloadEvent.Create(chain.Uid ?? "", multi.ResId);
        var results = await Collection.Business.SendEvent(@event);
        if (results.Count != 0)
        {
            var result = (MultiMsgDownloadEvent)results[0];
            multi.Chains.AddRange((IEnumerable<MessageChain>?)result.Chains ?? Array.Empty<MessageChain>());
            
            string uid = (chain.IsGroup
                ? await Collection.Business.CachingLogic.ResolveUid(chain.GroupUin, chain.FriendUin)
                : chain.Uid) ?? "";
            foreach (var messageChain in (IEnumerable<MessageChain>?)result.Chains ?? Array.Empty<MessageChain>())
            {
                   await ResolveIncomingChain(messageChain,true,uid,chain.IsGroup);
            }
        }
        
        break;
    }

期望的结果是什么?

正确获取到未失效的rkey

实际的结果是什么?

获取到了各种奇奇怪怪的rkey, 似乎是转发消息原始发送者的rkey, 和自己发送消息得到的rkey不一样

简单的复现代码/链接(可选)

No response

Trace 级别日志记录(可选)

No response

补充说明(可选)

No response

@RikaCelery RikaCelery added the bug? Maybe it's a bug label Jun 18, 2024
@RikaCelery
Copy link
Contributor Author

🤔是不是我不该这么改, 我现在是保存未失效的rkey然后在下载失败的时候替换一下

@ghost
Copy link

ghost commented Jun 19, 2024

这个的话我觉得不应该由拉格兰来处理.png
但是其实已经在建立关于RKey的缓存了 NTQQ也是开了一个池来村Rkey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug? Maybe it's a bug
Projects
None yet
Development

No branches or pull requests

1 participant