Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
在群聊里收到非 NTQQ 旧客户端发送的图片时,Milky 收到的是一条没有任何消息段的空消息。
原因
旧客户端发图时只发送旧的图片元素
CustomFace,没有 NTQQ 的CommonElem(business type 10 / 20)。ImageEntity.Parse只解析CommonElem,所以这些图片被丢掉了。修改
ImageEntity.Parse:消息里没有 NTQQ 图片的CommonElem时,解析旧的图片元素CustomFace/NotOnlineImage。CommonElem时不解析它们,同一张图不会出现两次。OrigUrl:带&fileid=的拼在https://multimedia.nt.qq.com.cn后面,其他的拼在https://gchat.qpic.cn后面。FileName、FileMd5、FileSize、ImageSize、SubType和Summary。NotOnlineImage增加PbReserve1,用来读取SubType和Summary。PbReserve本身仍然是byte[],所以上传时返回的兼容元素会原样发回。ImageEntity.Postprocess:没有MsgInfo时直接返回,因为旧图片的 url 已经从元素里得到了。解析方式与 V1 的
ImageEntity一致。旧图片没有 NTQQ 的资源 id,所以 Milky 的
resource_id为空,需要使用temp_url。测试
在 linux-x64 构建(trimmed,非 AOT)上,在群聊里接收旧客户端发送的图片和动画表情:
image段,动画表情的sub_type是sticker,summary是[动画表情];temp_url可以下载到原图,md5 与元素里的一致。