Refactor Api types 150-179 to use struct-wrapped constructors

- Update pattern matches to use struct-based extraction for inputPeer*,
  inputMedia*, inputReplyTo*, inputSticker*, inputPhoto, inputUser, etc.
- Wrap constructor calls with .init() for struct-wrapped enum cases
- 47 TelegramCore source files modified
- 5 TelegramApi files regenerated with --struct-count=180

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Isaac
2026-01-16 15:18:11 +08:00
parent 33a0d9e62c
commit e68bdc05ca
52 changed files with 1391 additions and 394 deletions

View File

@@ -215,17 +215,17 @@ private func synchronizeChatInputState(transaction: Transaction, postbox: Postbo
innerFlags |= 1 << 6
}
if !discard {
replyTo = .inputReplyToMessage(flags: innerFlags, replyToMsgId: replySubject.messageId.id, topMsgId: topMsgId, replyToPeerId: replyToPeer, quoteText: quoteText, quoteEntities: quoteEntities, quoteOffset: quoteOffset, monoforumPeerId: monoforumPeerId, todoItemId: replyTodoItemId)
replyTo = .inputReplyToMessage(.init(flags: innerFlags, replyToMsgId: replySubject.messageId.id, topMsgId: topMsgId, replyToPeerId: replyToPeer, quoteText: quoteText, quoteEntities: quoteEntities, quoteOffset: quoteOffset, monoforumPeerId: monoforumPeerId, todoItemId: replyTodoItemId))
}
} else if let topMsgId {
flags |= 1 << 0
var innerFlags: Int32 = 0
innerFlags |= 1 << 0
replyTo = .inputReplyToMessage(flags: innerFlags, replyToMsgId: topMsgId, topMsgId: topMsgId, replyToPeerId: nil, quoteText: nil, quoteEntities: nil, quoteOffset: nil, monoforumPeerId: nil, todoItemId: nil)
replyTo = .inputReplyToMessage(.init(flags: innerFlags, replyToMsgId: topMsgId, topMsgId: topMsgId, replyToPeerId: nil, quoteText: nil, quoteEntities: nil, quoteOffset: nil, monoforumPeerId: nil, todoItemId: nil))
} else if let monoforumPeerId {
flags |= 1 << 0
replyTo = .inputReplyToMonoForum(monoforumPeerId: monoforumPeerId)
replyTo = .inputReplyToMonoForum(.init(monoforumPeerId: monoforumPeerId))
}
let suggestedPost = inputState?.suggestedPost.flatMap { suggestedPost -> Api.SuggestedPost in