feat: 协议更新
This commit is contained in:
@@ -42,16 +42,16 @@ public class BotAppInfo
|
||||
Os = "Linux",
|
||||
Kernel = "Linux",
|
||||
VendorOs = "linux",
|
||||
CurrentVersion = "3.2.15-30366",
|
||||
CurrentVersion = "3.2.19-39038",
|
||||
MiscBitmap = 32764,
|
||||
PtVersion = "2.0.0",
|
||||
SsoVersion = 19,
|
||||
PackageName = "com.tencent.qq",
|
||||
WtLoginSdk = "nt.wtlogin.0.0.1",
|
||||
AppId = 1600001615,
|
||||
SubAppId = 537258424,
|
||||
AppIdQrCode = 13697054,
|
||||
AppClientVersion = 30366,
|
||||
SubAppId = 537313942,
|
||||
AppIdQrCode = 537313942,
|
||||
AppClientVersion = 39038,
|
||||
|
||||
MainSigMap = 169742560,
|
||||
SubSigMap = 0,
|
||||
|
||||
@@ -71,13 +71,16 @@ internal class MessagingLogic : LogicBase
|
||||
var chain = push.Chain;
|
||||
|
||||
// Intercept group invitation
|
||||
if (chain.Count == 1 && chain[0] is LightAppEntity { AppName: "com.tencent.qun.invite" } app)
|
||||
if (chain.Count == 1 && chain[0] is LightAppEntity
|
||||
{
|
||||
AppName: "com.tencent.qun.invite" or "com.tencent.tuwen.lua"
|
||||
} app)
|
||||
{
|
||||
using var document = JsonDocument.Parse(app.Payload);
|
||||
var root = document.RootElement;
|
||||
|
||||
string url = root.GetProperty("meta").GetProperty("news").GetProperty("jumpUrl").GetString()
|
||||
?? throw new Exception("sb tx! Is this 'com.tencent.qun.invite'?");
|
||||
?? throw new Exception("sb tx! Is this 'com.tencent.qun.invite' or 'com.tencent.tuwen.lua'?");
|
||||
var query = HttpUtility.ParseQueryString(new Uri(url).Query);
|
||||
uint groupUin = uint.Parse(query["groupcode"]
|
||||
?? throw new Exception("sb tx! Is this '/group/invite_join'?"));
|
||||
|
||||
@@ -85,6 +85,14 @@ public class ForwardEntity : IMessageEntity
|
||||
{
|
||||
if (elem.SrcMsg is not { } src) return null;
|
||||
|
||||
if (src.SourceMsg != null)
|
||||
{
|
||||
var chain = MessagePacker.Parse(Serializer.Deserialize<PushMsgBody>(src.SourceMsg.AsSpan()), true);
|
||||
return new ForwardEntity(chain);
|
||||
}
|
||||
|
||||
if (src.PbReserve != null)
|
||||
{
|
||||
var reserve = Serializer.Deserialize<SrcMsg.Preserve>(src.PbReserve.AsSpan());
|
||||
return new ForwardEntity(MessagePacker.Parse(new PushMsgBody
|
||||
{
|
||||
@@ -97,7 +105,7 @@ public class ForwardEntity : IMessageEntity
|
||||
ContentHead = new ContentHead
|
||||
{
|
||||
Random = (long?)(reserve.MessageId & 0xFFFFFFFF),
|
||||
Sequence = src.OrigSeqs?.Count > 0 ? src.OrigSeqs[0] : 0,
|
||||
Sequence = (src.OrigSeqs != null && src.OrigSeqs.Count > 0) ? src.OrigSeqs[0] : 0,
|
||||
Timestamp = src.Time,
|
||||
},
|
||||
Body = new MessageBody
|
||||
@@ -110,6 +118,9 @@ public class ForwardEntity : IMessageEntity
|
||||
}, true));
|
||||
}
|
||||
|
||||
return new ForwardEntity(new MessageChain(0, 0, (src.OrigSeqs != null && src.OrigSeqs.Count > 0 ? src.OrigSeqs[0] : 0), 0));
|
||||
}
|
||||
|
||||
void IMessageEntity.SetSelfUid(string selfUid) => _selfUid = selfUid;
|
||||
|
||||
string IMessageEntity.ToPreviewString() => $"[Forward] {{ {Chain.Sequence} }}";
|
||||
|
||||
@@ -2,5 +2,5 @@ namespace Lagrange.Core.Utility.Sign;
|
||||
|
||||
internal class LinuxSigner : UrlSigner
|
||||
{
|
||||
public LinuxSigner() : base("https://sign.lagrangecore.org/api/sign/30366") { }
|
||||
public LinuxSigner() : base("https://sign.lagrangecore.org/api/sign/39038") { }
|
||||
}
|
||||
Reference in New Issue
Block a user