fix(messages): sync recognize configured app link entities

This commit is contained in:
iamxvbaba 2026-08-01 00:12:02 +08:00
parent 35d3908660
commit c9371c6048
12 changed files with 327 additions and 72 deletions

View file

@ -303,7 +303,7 @@ func TestMonoforumSendMessageWritePath(t *testing.T) {
}
// TDesktop 的订阅者请求不携带 InputReplyToMonoForum;服务端必须从调用者推导 saved_peer=self。
subReq := &tg.MessagesSendMessageRequest{Peer: monoInput, Message: "hi from sub", RandomID: 555}
subReq := &tg.MessagesSendMessageRequest{Peer: monoInput, Message: "hi from sub telesrv://resolve?domain=Owner", RandomID: 555}
subReq.ClearDraft = true
subReq.SetAllowPaidStars(20)
suggestedInput := tg.SuggestedPost{}
@ -325,6 +325,15 @@ func TestMonoforumSendMessageWritePath(t *testing.T) {
if message, ok := newMessage.Message.(*tg.Message); ok {
subMessageID = message.ID
subPaidStars, _ = message.GetPaidMessageStars()
var hasAppLink bool
for _, entity := range message.Entities {
if url, ok := entity.(*tg.MessageEntityURL); ok && url.Offset == utf16CodeUnitLen("hi from sub ") && url.Length == utf16CodeUnitLen("telesrv://resolve?domain=Owner") {
hasAppLink = true
}
}
if !hasAppLink {
t.Fatalf("monoforum message missing configured app-link entity: %+v", message.Entities)
}
}
}
if balance, ok := update.(*tg.UpdateStarsBalance); ok {