mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Refactoring
This commit is contained in:
parent
e77402d7b3
commit
1f869f309f
@ -1,6 +1,6 @@
|
||||
#import <FFMpegBinding/FFMpegAVCodec.h>
|
||||
|
||||
#import "libavcodec/avcodec.h"
|
||||
#import <third_party/ffmpeg/libavcodec/avcodec.h>
|
||||
|
||||
@interface FFMpegAVCodec () {
|
||||
AVCodec const *_impl;
|
||||
|
@ -3,8 +3,8 @@
|
||||
#import <FFMpegBinding/FFMpegAVFrame.h>
|
||||
#import <FFMpegBinding/FFMpegAVCodec.h>
|
||||
|
||||
#import "libavformat/avformat.h"
|
||||
#import "libavcodec/avcodec.h"
|
||||
#import <third_party/ffmpeg/libavformat/avformat.h>
|
||||
#import <third_party/ffmpeg/libavcodec/avcodec.h>
|
||||
|
||||
static enum AVPixelFormat getPreferredPixelFormat(__unused AVCodecContext *ctx, __unused const enum AVPixelFormat *pix_fmts) {
|
||||
return AV_PIX_FMT_VIDEOTOOLBOX;
|
||||
|
@ -4,8 +4,8 @@
|
||||
#import <FFMpegBinding/FFMpegPacket.h>
|
||||
#import <FFMpegBinding/FFMpegAVCodecContext.h>
|
||||
|
||||
#import "libavcodec/avcodec.h"
|
||||
#import "libavformat/avformat.h"
|
||||
#import <third_party/ffmpeg/libavcodec/avcodec.h>
|
||||
#import <third_party/ffmpeg/libavformat/avformat.h>
|
||||
|
||||
int FFMpegCodecIdH264 = AV_CODEC_ID_H264;
|
||||
int FFMpegCodecIdHEVC = AV_CODEC_ID_HEVC;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#import <FFMpegBinding/FFMpegAVFrame.h>
|
||||
|
||||
#import "libavformat/avformat.h"
|
||||
#import <third_party/ffmpeg/libavformat/avformat.h>
|
||||
|
||||
@interface FFMpegAVFrame () {
|
||||
AVFrame *_impl;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#import <FFMpegBinding/FFMpegAVIOContext.h>
|
||||
|
||||
#import "libavformat/avformat.h"
|
||||
#import <third_party/ffmpeg/libavformat/avformat.h>
|
||||
|
||||
int FFMPEG_CONSTANT_AVERROR_EOF = AVERROR_EOF;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#import <FFMpegBinding/FFMpegGlobals.h>
|
||||
|
||||
#import "libavformat/avformat.h"
|
||||
#import <third_party/ffmpeg/libavformat/avformat.h>
|
||||
|
||||
@implementation FFMpegGlobals
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
#import <FFMpegBinding/FFMpegLiveMuxer.h>
|
||||
#import <FFMpegBinding/FFMpegAVIOContext.h>
|
||||
|
||||
#include "libavutil/timestamp.h"
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libswresample/swresample.h"
|
||||
#include <third_party/ffmpeg/libavutil/timestamp.h>
|
||||
#include <third_party/ffmpeg/libavformat/avformat.h>
|
||||
#include <third_party/ffmpeg/libavcodec/avcodec.h>
|
||||
#include <third_party/ffmpeg/libswresample/swresample.h>
|
||||
|
||||
#define MOV_TIMESCALE 1000
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
#import <FFMpegBinding/FFMpegAVCodecContext.h>
|
||||
|
||||
#import "libavcodec/avcodec.h"
|
||||
#import "libavformat/avformat.h"
|
||||
#import <third_party/ffmpeg/libavcodec/avcodec.h>
|
||||
#import <third_party/ffmpeg/libavformat/avformat.h>
|
||||
|
||||
@interface FFMpegPacket () {
|
||||
AVPacket *_impl;
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
#import <FFMpegBinding/FFMpegAVIOContext.h>
|
||||
|
||||
#include "libavutil/timestamp.h"
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include <third_party/ffmpeg/libavutil/timestamp.h>
|
||||
#include <third_party/ffmpeg/libavformat/avformat.h>
|
||||
#include <third_party/ffmpeg/libavcodec/avcodec.h>
|
||||
|
||||
#define MOV_TIMESCALE 1000
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
#import <FFMpegBinding/FFMpegAVFrame.h>
|
||||
|
||||
#import "libavformat/avformat.h"
|
||||
#import "libavcodec/avcodec.h"
|
||||
#import "libswresample/swresample.h"
|
||||
#import <third_party/ffmpeg/libavformat/avformat.h>
|
||||
#import <third_party/ffmpeg/libavcodec/avcodec.h>
|
||||
#import <third_party/ffmpeg/libswresample/swresample.h>
|
||||
|
||||
@interface FFMpegSWResample () {
|
||||
int _sourceSampleRate;
|
||||
|
@ -1,9 +1,9 @@
|
||||
#import <FFMpegBinding/FFMpegVideoWriter.h>
|
||||
#import <FFMpegBinding/FFMpegAVFrame.h>
|
||||
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
#include <third_party/ffmpeg/libavformat/avformat.h>
|
||||
#include <third_party/ffmpeg/libavcodec/avcodec.h>
|
||||
#include <third_party/ffmpeg/libavutil/imgutils.h>
|
||||
|
||||
@interface FFMpegVideoWriter ()
|
||||
|
||||
|
@ -24,11 +24,9 @@ objc_library(
|
||||
],
|
||||
hdrs = glob([
|
||||
"lottiecpp/PublicHeaders/**/*.h",
|
||||
"lottiecpp/PlatformSpecific/Darwin/PublicHeaders/**/*.h",
|
||||
]),
|
||||
includes = [
|
||||
"lottiecpp/PublicHeaders",
|
||||
"lottiecpp/PlatformSpecific/Darwin/PublicHeaders",
|
||||
],
|
||||
deps = [
|
||||
],
|
||||
|
@ -16,7 +16,7 @@ objc_library(
|
||||
],
|
||||
deps = [
|
||||
"//third-party/mozjpeg:mozjpeg",
|
||||
"//third-party/libjxl:jxl",
|
||||
#"//third-party/libjxl:jxl",
|
||||
],
|
||||
visibility = [
|
||||
"//visibility:public",
|
||||
|
@ -7,12 +7,14 @@
|
||||
|
||||
#import <Accelerate/Accelerate.h>
|
||||
|
||||
#ifdef USE_JPEGXL
|
||||
#include <jxl/encode.h>
|
||||
#include <jxl/encode_cxx.h>
|
||||
#include <jxl/decode.h>
|
||||
#include <jxl/decode_cxx.h>
|
||||
//#include <jxl/thread_parallel_runner.h>
|
||||
//#include <jxl/thread_parallel_runner_cxx.h>
|
||||
#endif
|
||||
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
@ -31,6 +33,7 @@ static inline float JXLGetDistance(int32_t quality) {
|
||||
}
|
||||
|
||||
NSData * _Nullable compressJPEGXLData(UIImage * _Nonnull sourceImage, int quality) {
|
||||
#ifdef USE_JPEGXL
|
||||
int width = (int)(sourceImage.size.width * sourceImage.scale);
|
||||
int height = (int)(sourceImage.size.height * sourceImage.scale);
|
||||
|
||||
@ -140,9 +143,13 @@ NSData * _Nullable compressJPEGXLData(UIImage * _Nonnull sourceImage, int qualit
|
||||
fprintf(stderr, "JxlEncoderSetParallelRunner failed\n");
|
||||
return false;
|
||||
}*/
|
||||
#else
|
||||
return nil;
|
||||
#endif
|
||||
}
|
||||
|
||||
UIImage * _Nullable decompressJPEGXLData(NSData * _Nonnull data) {
|
||||
#ifdef USE_JPEGXL
|
||||
//const uint8_t* jxl, size_t size, std::vector<float>* pixels, size_t* xsize, size_t* ysize, std::vector<uint8_t>* icc_profile
|
||||
|
||||
auto dec = JxlDecoderMake(nullptr);
|
||||
@ -266,6 +273,9 @@ UIImage * _Nullable decompressJPEGXLData(NSData * _Nonnull data) {
|
||||
}
|
||||
|
||||
return nil;
|
||||
#else
|
||||
return nil;
|
||||
#endif
|
||||
}
|
||||
|
||||
static NSData *getHeaderPattern() {
|
||||
|
@ -55,3 +55,9 @@
|
||||
#import <MtProtoKit/MTTransport.h>
|
||||
#import <MtProtoKit/MTTransportScheme.h>
|
||||
#import <MtProtoKit/MTTransportTransaction.h>
|
||||
#import <MtProtoKit/MTProtoInstance.h>
|
||||
#import <MtProtoKit/MTProtoPersistenceInterface.h>
|
||||
#import <MtProtoKit/MTProtoEngine.h>
|
||||
#import <MtProtoKit/MTBindKeyMessageService.h>
|
||||
#import <MtProtoKit/MTFileBasedKeychain.h>
|
||||
|
||||
|
@ -171,6 +171,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[589338437] = { return Api.ChannelAdminLogEventAction.parse_channelAdminLogEventActionStartGroupCall($0) }
|
||||
dict[-1895328189] = { return Api.ChannelAdminLogEventAction.parse_channelAdminLogEventActionStopPoll($0) }
|
||||
dict[1693675004] = { return Api.ChannelAdminLogEventAction.parse_channelAdminLogEventActionToggleAntiSpam($0) }
|
||||
dict[-988285058] = { return Api.ChannelAdminLogEventAction.parse_channelAdminLogEventActionToggleAutotranslation($0) }
|
||||
dict[46949251] = { return Api.ChannelAdminLogEventAction.parse_channelAdminLogEventActionToggleForum($0) }
|
||||
dict[1456906823] = { return Api.ChannelAdminLogEventAction.parse_channelAdminLogEventActionToggleGroupCallSetting($0) }
|
||||
dict[460916654] = { return Api.ChannelAdminLogEventAction.parse_channelAdminLogEventActionToggleInvites($0) }
|
||||
@ -467,6 +468,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[583071445] = { return Api.InputReplyTo.parse_inputReplyToMessage($0) }
|
||||
dict[1484862010] = { return Api.InputReplyTo.parse_inputReplyToStory($0) }
|
||||
dict[-251549057] = { return Api.InputSavedStarGift.parse_inputSavedStarGiftChat($0) }
|
||||
dict[545636920] = { return Api.InputSavedStarGift.parse_inputSavedStarGiftSlug($0) }
|
||||
dict[1764202389] = { return Api.InputSavedStarGift.parse_inputSavedStarGiftUser($0) }
|
||||
dict[1399317950] = { return Api.InputSecureFile.parse_inputSecureFile($0) }
|
||||
dict[859091184] = { return Api.InputSecureFile.parse_inputSecureFileUploaded($0) }
|
||||
@ -601,7 +603,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[1348510708] = { return Api.MessageAction.parse_messageActionSetChatWallPaper($0) }
|
||||
dict[1007897979] = { return Api.MessageAction.parse_messageActionSetMessagesTTL($0) }
|
||||
dict[1192749220] = { return Api.MessageAction.parse_messageActionStarGift($0) }
|
||||
dict[1600878025] = { return Api.MessageAction.parse_messageActionStarGiftUnique($0) }
|
||||
dict[775611918] = { return Api.MessageAction.parse_messageActionStarGiftUnique($0) }
|
||||
dict[1474192222] = { return Api.MessageAction.parse_messageActionSuggestProfilePhoto($0) }
|
||||
dict[228168278] = { return Api.MessageAction.parse_messageActionTopicCreate($0) }
|
||||
dict[-1064024032] = { return Api.MessageAction.parse_messageActionTopicEdit($0) }
|
||||
@ -747,6 +749,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[-1721619444] = { return Api.PeerNotifySettings.parse_peerNotifySettings($0) }
|
||||
dict[-193510921] = { return Api.PeerSettings.parse_peerSettings($0) }
|
||||
dict[-1707742823] = { return Api.PeerStories.parse_peerStories($0) }
|
||||
dict[-404214254] = { return Api.PendingSuggestion.parse_pendingSuggestion($0) }
|
||||
dict[810769141] = { return Api.PhoneCall.parse_phoneCall($0) }
|
||||
dict[912311057] = { return Api.PhoneCall.parse_phoneCallAccepted($0) }
|
||||
dict[1355435489] = { return Api.PhoneCall.parse_phoneCallDiscarded($0) }
|
||||
@ -870,7 +873,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[289586518] = { return Api.SavedContact.parse_savedPhoneContact($0) }
|
||||
dict[-1115174036] = { return Api.SavedDialog.parse_savedDialog($0) }
|
||||
dict[-881854424] = { return Api.SavedReactionTag.parse_savedReactionTag($0) }
|
||||
dict[1616305061] = { return Api.SavedStarGift.parse_savedStarGift($0) }
|
||||
dict[-539360103] = { return Api.SavedStarGift.parse_savedStarGift($0) }
|
||||
dict[-911191137] = { return Api.SearchResultsCalendarPeriod.parse_searchResultsCalendarPeriod($0) }
|
||||
dict[2137295719] = { return Api.SearchResultsPosition.parse_searchResultPosition($0) }
|
||||
dict[871426631] = { return Api.SecureCredentialsEncrypted.parse_secureCredentialsEncrypted($0) }
|
||||
@ -1297,7 +1300,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[16313608] = { return Api.help.PeerColors.parse_peerColors($0) }
|
||||
dict[732034510] = { return Api.help.PeerColors.parse_peerColorsNotModified($0) }
|
||||
dict[1395946908] = { return Api.help.PremiumPromo.parse_premiumPromo($0) }
|
||||
dict[-1942390465] = { return Api.help.PromoData.parse_promoData($0) }
|
||||
dict[145021050] = { return Api.help.PromoData.parse_promoData($0) }
|
||||
dict[-1728664459] = { return Api.help.PromoData.parse_promoDataEmpty($0) }
|
||||
dict[235081943] = { return Api.help.RecentMeUrls.parse_recentMeUrls($0) }
|
||||
dict[398898678] = { return Api.help.Support.parse_support($0) }
|
||||
@ -1460,6 +1463,7 @@ fileprivate let parsers: [Int32 : (BufferReader) -> Any?] = {
|
||||
dict[276907596] = { return Api.storage.FileType.parse_fileWebp($0) }
|
||||
dict[1862033025] = { return Api.stories.AllStories.parse_allStories($0) }
|
||||
dict[291044926] = { return Api.stories.AllStories.parse_allStoriesNotModified($0) }
|
||||
dict[-1014513586] = { return Api.stories.CanSendStoryCount.parse_canSendStoryCount($0) }
|
||||
dict[-488736969] = { return Api.stories.FoundStories.parse_foundStories($0) }
|
||||
dict[-890861720] = { return Api.stories.PeerStories.parse_peerStories($0) }
|
||||
dict[1673780490] = { return Api.stories.Stories.parse_stories($0) }
|
||||
@ -2001,6 +2005,8 @@ public extension Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.PeerStories:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.PendingSuggestion:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.PhoneCall:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.PhoneCallDiscardReason:
|
||||
@ -2591,6 +2597,8 @@ public extension Api {
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.stories.AllStories:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.stories.CanSendStoryCount:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.stories.FoundStories:
|
||||
_1.serialize(buffer, boxed)
|
||||
case let _1 as Api.stories.PeerStories:
|
||||
|
@ -367,6 +367,7 @@ public extension Api {
|
||||
public extension Api {
|
||||
indirect enum InputSavedStarGift: TypeConstructorDescription {
|
||||
case inputSavedStarGiftChat(peer: Api.InputPeer, savedId: Int64)
|
||||
case inputSavedStarGiftSlug(slug: String)
|
||||
case inputSavedStarGiftUser(msgId: Int32)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
@ -378,6 +379,12 @@ public extension Api {
|
||||
peer.serialize(buffer, true)
|
||||
serializeInt64(savedId, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .inputSavedStarGiftSlug(let slug):
|
||||
if boxed {
|
||||
buffer.appendInt32(545636920)
|
||||
}
|
||||
serializeString(slug, buffer: buffer, boxed: false)
|
||||
break
|
||||
case .inputSavedStarGiftUser(let msgId):
|
||||
if boxed {
|
||||
buffer.appendInt32(1764202389)
|
||||
@ -391,6 +398,8 @@ public extension Api {
|
||||
switch self {
|
||||
case .inputSavedStarGiftChat(let peer, let savedId):
|
||||
return ("inputSavedStarGiftChat", [("peer", peer as Any), ("savedId", savedId as Any)])
|
||||
case .inputSavedStarGiftSlug(let slug):
|
||||
return ("inputSavedStarGiftSlug", [("slug", slug as Any)])
|
||||
case .inputSavedStarGiftUser(let msgId):
|
||||
return ("inputSavedStarGiftUser", [("msgId", msgId as Any)])
|
||||
}
|
||||
@ -412,6 +421,17 @@ public extension Api {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_inputSavedStarGiftSlug(_ reader: BufferReader) -> InputSavedStarGift? {
|
||||
var _1: String?
|
||||
_1 = parseString(reader)
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.InputSavedStarGift.inputSavedStarGiftSlug(slug: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_inputSavedStarGiftUser(_ reader: BufferReader) -> InputSavedStarGift? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
|
@ -381,7 +381,7 @@ public extension Api {
|
||||
case messageActionSetChatWallPaper(flags: Int32, wallpaper: Api.WallPaper)
|
||||
case messageActionSetMessagesTTL(flags: Int32, period: Int32, autoSettingFrom: Int64?)
|
||||
case messageActionStarGift(flags: Int32, gift: Api.StarGift, message: Api.TextWithEntities?, convertStars: Int64?, upgradeMsgId: Int32?, upgradeStars: Int64?, fromId: Api.Peer?, peer: Api.Peer?, savedId: Int64?)
|
||||
case messageActionStarGiftUnique(flags: Int32, gift: Api.StarGift, canExportAt: Int32?, transferStars: Int64?, fromId: Api.Peer?, peer: Api.Peer?, savedId: Int64?, resaleStars: Int64?)
|
||||
case messageActionStarGiftUnique(flags: Int32, gift: Api.StarGift, canExportAt: Int32?, transferStars: Int64?, fromId: Api.Peer?, peer: Api.Peer?, savedId: Int64?, resaleStars: Int64?, canTransferAt: Int32?, canResellAt: Int32?)
|
||||
case messageActionSuggestProfilePhoto(photo: Api.Photo)
|
||||
case messageActionTopicCreate(flags: Int32, title: String, iconColor: Int32, iconEmojiId: Int64?)
|
||||
case messageActionTopicEdit(flags: Int32, title: String?, iconEmojiId: Int64?, closed: Api.Bool?, hidden: Api.Bool?)
|
||||
@ -767,9 +767,9 @@ public extension Api {
|
||||
if Int(flags) & Int(1 << 12) != 0 {peer!.serialize(buffer, true)}
|
||||
if Int(flags) & Int(1 << 12) != 0 {serializeInt64(savedId!, buffer: buffer, boxed: false)}
|
||||
break
|
||||
case .messageActionStarGiftUnique(let flags, let gift, let canExportAt, let transferStars, let fromId, let peer, let savedId, let resaleStars):
|
||||
case .messageActionStarGiftUnique(let flags, let gift, let canExportAt, let transferStars, let fromId, let peer, let savedId, let resaleStars, let canTransferAt, let canResellAt):
|
||||
if boxed {
|
||||
buffer.appendInt32(1600878025)
|
||||
buffer.appendInt32(775611918)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
gift.serialize(buffer, true)
|
||||
@ -779,6 +779,8 @@ public extension Api {
|
||||
if Int(flags) & Int(1 << 7) != 0 {peer!.serialize(buffer, true)}
|
||||
if Int(flags) & Int(1 << 7) != 0 {serializeInt64(savedId!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 8) != 0 {serializeInt64(resaleStars!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 9) != 0 {serializeInt32(canTransferAt!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 10) != 0 {serializeInt32(canResellAt!, buffer: buffer, boxed: false)}
|
||||
break
|
||||
case .messageActionSuggestProfilePhoto(let photo):
|
||||
if boxed {
|
||||
@ -913,8 +915,8 @@ public extension Api {
|
||||
return ("messageActionSetMessagesTTL", [("flags", flags as Any), ("period", period as Any), ("autoSettingFrom", autoSettingFrom as Any)])
|
||||
case .messageActionStarGift(let flags, let gift, let message, let convertStars, let upgradeMsgId, let upgradeStars, let fromId, let peer, let savedId):
|
||||
return ("messageActionStarGift", [("flags", flags as Any), ("gift", gift as Any), ("message", message as Any), ("convertStars", convertStars as Any), ("upgradeMsgId", upgradeMsgId as Any), ("upgradeStars", upgradeStars as Any), ("fromId", fromId as Any), ("peer", peer as Any), ("savedId", savedId as Any)])
|
||||
case .messageActionStarGiftUnique(let flags, let gift, let canExportAt, let transferStars, let fromId, let peer, let savedId, let resaleStars):
|
||||
return ("messageActionStarGiftUnique", [("flags", flags as Any), ("gift", gift as Any), ("canExportAt", canExportAt as Any), ("transferStars", transferStars as Any), ("fromId", fromId as Any), ("peer", peer as Any), ("savedId", savedId as Any), ("resaleStars", resaleStars as Any)])
|
||||
case .messageActionStarGiftUnique(let flags, let gift, let canExportAt, let transferStars, let fromId, let peer, let savedId, let resaleStars, let canTransferAt, let canResellAt):
|
||||
return ("messageActionStarGiftUnique", [("flags", flags as Any), ("gift", gift as Any), ("canExportAt", canExportAt as Any), ("transferStars", transferStars as Any), ("fromId", fromId as Any), ("peer", peer as Any), ("savedId", savedId as Any), ("resaleStars", resaleStars as Any), ("canTransferAt", canTransferAt as Any), ("canResellAt", canResellAt as Any)])
|
||||
case .messageActionSuggestProfilePhoto(let photo):
|
||||
return ("messageActionSuggestProfilePhoto", [("photo", photo as Any)])
|
||||
case .messageActionTopicCreate(let flags, let title, let iconColor, let iconEmojiId):
|
||||
@ -1675,6 +1677,10 @@ public extension Api {
|
||||
if Int(_1!) & Int(1 << 7) != 0 {_7 = reader.readInt64() }
|
||||
var _8: Int64?
|
||||
if Int(_1!) & Int(1 << 8) != 0 {_8 = reader.readInt64() }
|
||||
var _9: Int32?
|
||||
if Int(_1!) & Int(1 << 9) != 0 {_9 = reader.readInt32() }
|
||||
var _10: Int32?
|
||||
if Int(_1!) & Int(1 << 10) != 0 {_10 = reader.readInt32() }
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = (Int(_1!) & Int(1 << 3) == 0) || _3 != nil
|
||||
@ -1683,8 +1689,10 @@ public extension Api {
|
||||
let _c6 = (Int(_1!) & Int(1 << 7) == 0) || _6 != nil
|
||||
let _c7 = (Int(_1!) & Int(1 << 7) == 0) || _7 != nil
|
||||
let _c8 = (Int(_1!) & Int(1 << 8) == 0) || _8 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 {
|
||||
return Api.MessageAction.messageActionStarGiftUnique(flags: _1!, gift: _2!, canExportAt: _3, transferStars: _4, fromId: _5, peer: _6, savedId: _7, resaleStars: _8)
|
||||
let _c9 = (Int(_1!) & Int(1 << 9) == 0) || _9 != nil
|
||||
let _c10 = (Int(_1!) & Int(1 << 10) == 0) || _10 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 {
|
||||
return Api.MessageAction.messageActionStarGiftUnique(flags: _1!, gift: _2!, canExportAt: _3, transferStars: _4, fromId: _5, peer: _6, savedId: _7, resaleStars: _8, canTransferAt: _9, canResellAt: _10)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
|
@ -1090,6 +1090,58 @@ public extension Api {
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum PendingSuggestion: TypeConstructorDescription {
|
||||
case pendingSuggestion(suggestion: String, title: Api.TextWithEntities, description: Api.TextWithEntities, url: String)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .pendingSuggestion(let suggestion, let title, let description, let url):
|
||||
if boxed {
|
||||
buffer.appendInt32(-404214254)
|
||||
}
|
||||
serializeString(suggestion, buffer: buffer, boxed: false)
|
||||
title.serialize(buffer, true)
|
||||
description.serialize(buffer, true)
|
||||
serializeString(url, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .pendingSuggestion(let suggestion, let title, let description, let url):
|
||||
return ("pendingSuggestion", [("suggestion", suggestion as Any), ("title", title as Any), ("description", description as Any), ("url", url as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_pendingSuggestion(_ reader: BufferReader) -> PendingSuggestion? {
|
||||
var _1: String?
|
||||
_1 = parseString(reader)
|
||||
var _2: Api.TextWithEntities?
|
||||
if let signature = reader.readInt32() {
|
||||
_2 = Api.parse(reader, signature: signature) as? Api.TextWithEntities
|
||||
}
|
||||
var _3: Api.TextWithEntities?
|
||||
if let signature = reader.readInt32() {
|
||||
_3 = Api.parse(reader, signature: signature) as? Api.TextWithEntities
|
||||
}
|
||||
var _4: String?
|
||||
_4 = parseString(reader)
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
let _c4 = _4 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 {
|
||||
return Api.PendingSuggestion.pendingSuggestion(suggestion: _1!, title: _2!, description: _3!, url: _4!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api {
|
||||
enum PhoneCall: TypeConstructorDescription {
|
||||
case phoneCall(flags: Int32, id: Int64, accessHash: Int64, date: Int32, adminId: Int64, participantId: Int64, gAOrB: Buffer, keyFingerprint: Int64, protocol: Api.PhoneCallProtocol, connections: [Api.PhoneConnection], startDate: Int32, customParameters: Api.DataJSON?)
|
||||
|
@ -144,13 +144,13 @@ public extension Api {
|
||||
}
|
||||
public extension Api {
|
||||
enum SavedStarGift: TypeConstructorDescription {
|
||||
case savedStarGift(flags: Int32, fromId: Api.Peer?, date: Int32, gift: Api.StarGift, message: Api.TextWithEntities?, msgId: Int32?, savedId: Int64?, convertStars: Int64?, upgradeStars: Int64?, canExportAt: Int32?, transferStars: Int64?)
|
||||
case savedStarGift(flags: Int32, fromId: Api.Peer?, date: Int32, gift: Api.StarGift, message: Api.TextWithEntities?, msgId: Int32?, savedId: Int64?, convertStars: Int64?, upgradeStars: Int64?, canExportAt: Int32?, transferStars: Int64?, canTransferAt: Int32?, canResellAt: Int32?)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .savedStarGift(let flags, let fromId, let date, let gift, let message, let msgId, let savedId, let convertStars, let upgradeStars, let canExportAt, let transferStars):
|
||||
case .savedStarGift(let flags, let fromId, let date, let gift, let message, let msgId, let savedId, let convertStars, let upgradeStars, let canExportAt, let transferStars, let canTransferAt, let canResellAt):
|
||||
if boxed {
|
||||
buffer.appendInt32(1616305061)
|
||||
buffer.appendInt32(-539360103)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
if Int(flags) & Int(1 << 1) != 0 {fromId!.serialize(buffer, true)}
|
||||
@ -163,14 +163,16 @@ public extension Api {
|
||||
if Int(flags) & Int(1 << 6) != 0 {serializeInt64(upgradeStars!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 7) != 0 {serializeInt32(canExportAt!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 8) != 0 {serializeInt64(transferStars!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 13) != 0 {serializeInt32(canTransferAt!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 14) != 0 {serializeInt32(canResellAt!, buffer: buffer, boxed: false)}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .savedStarGift(let flags, let fromId, let date, let gift, let message, let msgId, let savedId, let convertStars, let upgradeStars, let canExportAt, let transferStars):
|
||||
return ("savedStarGift", [("flags", flags as Any), ("fromId", fromId as Any), ("date", date as Any), ("gift", gift as Any), ("message", message as Any), ("msgId", msgId as Any), ("savedId", savedId as Any), ("convertStars", convertStars as Any), ("upgradeStars", upgradeStars as Any), ("canExportAt", canExportAt as Any), ("transferStars", transferStars as Any)])
|
||||
case .savedStarGift(let flags, let fromId, let date, let gift, let message, let msgId, let savedId, let convertStars, let upgradeStars, let canExportAt, let transferStars, let canTransferAt, let canResellAt):
|
||||
return ("savedStarGift", [("flags", flags as Any), ("fromId", fromId as Any), ("date", date as Any), ("gift", gift as Any), ("message", message as Any), ("msgId", msgId as Any), ("savedId", savedId as Any), ("convertStars", convertStars as Any), ("upgradeStars", upgradeStars as Any), ("canExportAt", canExportAt as Any), ("transferStars", transferStars as Any), ("canTransferAt", canTransferAt as Any), ("canResellAt", canResellAt as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
@ -203,6 +205,10 @@ public extension Api {
|
||||
if Int(_1!) & Int(1 << 7) != 0 {_10 = reader.readInt32() }
|
||||
var _11: Int64?
|
||||
if Int(_1!) & Int(1 << 8) != 0 {_11 = reader.readInt64() }
|
||||
var _12: Int32?
|
||||
if Int(_1!) & Int(1 << 13) != 0 {_12 = reader.readInt32() }
|
||||
var _13: Int32?
|
||||
if Int(_1!) & Int(1 << 14) != 0 {_13 = reader.readInt32() }
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = (Int(_1!) & Int(1 << 1) == 0) || _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
@ -214,8 +220,10 @@ public extension Api {
|
||||
let _c9 = (Int(_1!) & Int(1 << 6) == 0) || _9 != nil
|
||||
let _c10 = (Int(_1!) & Int(1 << 7) == 0) || _10 != nil
|
||||
let _c11 = (Int(_1!) & Int(1 << 8) == 0) || _11 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 {
|
||||
return Api.SavedStarGift.savedStarGift(flags: _1!, fromId: _2, date: _3!, gift: _4!, message: _5, msgId: _6, savedId: _7, convertStars: _8, upgradeStars: _9, canExportAt: _10, transferStars: _11)
|
||||
let _c12 = (Int(_1!) & Int(1 << 13) == 0) || _12 != nil
|
||||
let _c13 = (Int(_1!) & Int(1 << 14) == 0) || _13 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 && _c11 && _c12 && _c13 {
|
||||
return Api.SavedStarGift.savedStarGift(flags: _1!, fromId: _2, date: _3!, gift: _4!, message: _5, msgId: _6, savedId: _7, convertStars: _8, upgradeStars: _9, canExportAt: _10, transferStars: _11, canTransferAt: _12, canResellAt: _13)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
|
@ -605,6 +605,7 @@ public extension Api {
|
||||
case channelAdminLogEventActionStartGroupCall(call: Api.InputGroupCall)
|
||||
case channelAdminLogEventActionStopPoll(message: Api.Message)
|
||||
case channelAdminLogEventActionToggleAntiSpam(newValue: Api.Bool)
|
||||
case channelAdminLogEventActionToggleAutotranslation(newValue: Api.Bool)
|
||||
case channelAdminLogEventActionToggleForum(newValue: Api.Bool)
|
||||
case channelAdminLogEventActionToggleGroupCallSetting(joinMuted: Api.Bool)
|
||||
case channelAdminLogEventActionToggleInvites(newValue: Api.Bool)
|
||||
@ -897,6 +898,12 @@ public extension Api {
|
||||
}
|
||||
newValue.serialize(buffer, true)
|
||||
break
|
||||
case .channelAdminLogEventActionToggleAutotranslation(let newValue):
|
||||
if boxed {
|
||||
buffer.appendInt32(-988285058)
|
||||
}
|
||||
newValue.serialize(buffer, true)
|
||||
break
|
||||
case .channelAdminLogEventActionToggleForum(let newValue):
|
||||
if boxed {
|
||||
buffer.appendInt32(46949251)
|
||||
@ -1039,6 +1046,8 @@ public extension Api {
|
||||
return ("channelAdminLogEventActionStopPoll", [("message", message as Any)])
|
||||
case .channelAdminLogEventActionToggleAntiSpam(let newValue):
|
||||
return ("channelAdminLogEventActionToggleAntiSpam", [("newValue", newValue as Any)])
|
||||
case .channelAdminLogEventActionToggleAutotranslation(let newValue):
|
||||
return ("channelAdminLogEventActionToggleAutotranslation", [("newValue", newValue as Any)])
|
||||
case .channelAdminLogEventActionToggleForum(let newValue):
|
||||
return ("channelAdminLogEventActionToggleForum", [("newValue", newValue as Any)])
|
||||
case .channelAdminLogEventActionToggleGroupCallSetting(let joinMuted):
|
||||
@ -1677,6 +1686,19 @@ public extension Api {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_channelAdminLogEventActionToggleAutotranslation(_ reader: BufferReader) -> ChannelAdminLogEventAction? {
|
||||
var _1: Api.Bool?
|
||||
if let signature = reader.readInt32() {
|
||||
_1 = Api.parse(reader, signature: signature) as? Api.Bool
|
||||
}
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.ChannelAdminLogEventAction.channelAdminLogEventActionToggleAutotranslation(newValue: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
public static func parse_channelAdminLogEventActionToggleForum(_ reader: BufferReader) -> ChannelAdminLogEventAction? {
|
||||
var _1: Api.Bool?
|
||||
if let signature = reader.readInt32() {
|
||||
|
@ -706,18 +706,31 @@ public extension Api.help {
|
||||
}
|
||||
public extension Api.help {
|
||||
enum PromoData: TypeConstructorDescription {
|
||||
case promoData(flags: Int32, expires: Int32, peer: Api.Peer, chats: [Api.Chat], users: [Api.User], psaType: String?, psaMessage: String?)
|
||||
case promoData(flags: Int32, expires: Int32, peer: Api.Peer?, psaType: String?, psaMessage: String?, pendingSuggestions: [String], dismissedSuggestions: [String], customPendingSuggestion: Api.PendingSuggestion?, chats: [Api.Chat], users: [Api.User])
|
||||
case promoDataEmpty(expires: Int32)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .promoData(let flags, let expires, let peer, let chats, let users, let psaType, let psaMessage):
|
||||
case .promoData(let flags, let expires, let peer, let psaType, let psaMessage, let pendingSuggestions, let dismissedSuggestions, let customPendingSuggestion, let chats, let users):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1942390465)
|
||||
buffer.appendInt32(145021050)
|
||||
}
|
||||
serializeInt32(flags, buffer: buffer, boxed: false)
|
||||
serializeInt32(expires, buffer: buffer, boxed: false)
|
||||
peer.serialize(buffer, true)
|
||||
if Int(flags) & Int(1 << 3) != 0 {peer!.serialize(buffer, true)}
|
||||
if Int(flags) & Int(1 << 1) != 0 {serializeString(psaType!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 2) != 0 {serializeString(psaMessage!, buffer: buffer, boxed: false)}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(pendingSuggestions.count))
|
||||
for item in pendingSuggestions {
|
||||
serializeString(item, buffer: buffer, boxed: false)
|
||||
}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(dismissedSuggestions.count))
|
||||
for item in dismissedSuggestions {
|
||||
serializeString(item, buffer: buffer, boxed: false)
|
||||
}
|
||||
if Int(flags) & Int(1 << 4) != 0 {customPendingSuggestion!.serialize(buffer, true)}
|
||||
buffer.appendInt32(481674261)
|
||||
buffer.appendInt32(Int32(chats.count))
|
||||
for item in chats {
|
||||
@ -728,8 +741,6 @@ public extension Api.help {
|
||||
for item in users {
|
||||
item.serialize(buffer, true)
|
||||
}
|
||||
if Int(flags) & Int(1 << 1) != 0 {serializeString(psaType!, buffer: buffer, boxed: false)}
|
||||
if Int(flags) & Int(1 << 2) != 0 {serializeString(psaMessage!, buffer: buffer, boxed: false)}
|
||||
break
|
||||
case .promoDataEmpty(let expires):
|
||||
if boxed {
|
||||
@ -742,8 +753,8 @@ public extension Api.help {
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .promoData(let flags, let expires, let peer, let chats, let users, let psaType, let psaMessage):
|
||||
return ("promoData", [("flags", flags as Any), ("expires", expires as Any), ("peer", peer as Any), ("chats", chats as Any), ("users", users as Any), ("psaType", psaType as Any), ("psaMessage", psaMessage as Any)])
|
||||
case .promoData(let flags, let expires, let peer, let psaType, let psaMessage, let pendingSuggestions, let dismissedSuggestions, let customPendingSuggestion, let chats, let users):
|
||||
return ("promoData", [("flags", flags as Any), ("expires", expires as Any), ("peer", peer as Any), ("psaType", psaType as Any), ("psaMessage", psaMessage as Any), ("pendingSuggestions", pendingSuggestions as Any), ("dismissedSuggestions", dismissedSuggestions as Any), ("customPendingSuggestion", customPendingSuggestion as Any), ("chats", chats as Any), ("users", users as Any)])
|
||||
case .promoDataEmpty(let expires):
|
||||
return ("promoDataEmpty", [("expires", expires as Any)])
|
||||
}
|
||||
@ -755,30 +766,45 @@ public extension Api.help {
|
||||
var _2: Int32?
|
||||
_2 = reader.readInt32()
|
||||
var _3: Api.Peer?
|
||||
if let signature = reader.readInt32() {
|
||||
if Int(_1!) & Int(1 << 3) != 0 {if let signature = reader.readInt32() {
|
||||
_3 = Api.parse(reader, signature: signature) as? Api.Peer
|
||||
}
|
||||
var _4: [Api.Chat]?
|
||||
} }
|
||||
var _4: String?
|
||||
if Int(_1!) & Int(1 << 1) != 0 {_4 = parseString(reader) }
|
||||
var _5: String?
|
||||
if Int(_1!) & Int(1 << 2) != 0 {_5 = parseString(reader) }
|
||||
var _6: [String]?
|
||||
if let _ = reader.readInt32() {
|
||||
_4 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self)
|
||||
_6 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self)
|
||||
}
|
||||
var _5: [Api.User]?
|
||||
var _7: [String]?
|
||||
if let _ = reader.readInt32() {
|
||||
_5 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
|
||||
_7 = Api.parseVector(reader, elementSignature: -1255641564, elementType: String.self)
|
||||
}
|
||||
var _8: Api.PendingSuggestion?
|
||||
if Int(_1!) & Int(1 << 4) != 0 {if let signature = reader.readInt32() {
|
||||
_8 = Api.parse(reader, signature: signature) as? Api.PendingSuggestion
|
||||
} }
|
||||
var _9: [Api.Chat]?
|
||||
if let _ = reader.readInt32() {
|
||||
_9 = Api.parseVector(reader, elementSignature: 0, elementType: Api.Chat.self)
|
||||
}
|
||||
var _10: [Api.User]?
|
||||
if let _ = reader.readInt32() {
|
||||
_10 = Api.parseVector(reader, elementSignature: 0, elementType: Api.User.self)
|
||||
}
|
||||
var _6: String?
|
||||
if Int(_1!) & Int(1 << 1) != 0 {_6 = parseString(reader) }
|
||||
var _7: String?
|
||||
if Int(_1!) & Int(1 << 2) != 0 {_7 = parseString(reader) }
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
let _c4 = _4 != nil
|
||||
let _c5 = _5 != nil
|
||||
let _c6 = (Int(_1!) & Int(1 << 1) == 0) || _6 != nil
|
||||
let _c7 = (Int(_1!) & Int(1 << 2) == 0) || _7 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 {
|
||||
return Api.help.PromoData.promoData(flags: _1!, expires: _2!, peer: _3!, chats: _4!, users: _5!, psaType: _6, psaMessage: _7)
|
||||
let _c3 = (Int(_1!) & Int(1 << 3) == 0) || _3 != nil
|
||||
let _c4 = (Int(_1!) & Int(1 << 1) == 0) || _4 != nil
|
||||
let _c5 = (Int(_1!) & Int(1 << 2) == 0) || _5 != nil
|
||||
let _c6 = _6 != nil
|
||||
let _c7 = _7 != nil
|
||||
let _c8 = (Int(_1!) & Int(1 << 4) == 0) || _8 != nil
|
||||
let _c9 = _9 != nil
|
||||
let _c10 = _10 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 && _c6 && _c7 && _c8 && _c9 && _c10 {
|
||||
return Api.help.PromoData.promoData(flags: _1!, expires: _2!, peer: _3, psaType: _4, psaMessage: _5, pendingSuggestions: _6!, dismissedSuggestions: _7!, customPendingSuggestion: _8, chats: _9!, users: _10!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
|
@ -760,6 +760,42 @@ public extension Api.stories {
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api.stories {
|
||||
enum CanSendStoryCount: TypeConstructorDescription {
|
||||
case canSendStoryCount(countRemains: Int32)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .canSendStoryCount(let countRemains):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1014513586)
|
||||
}
|
||||
serializeInt32(countRemains, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .canSendStoryCount(let countRemains):
|
||||
return ("canSendStoryCount", [("countRemains", countRemains as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_canSendStoryCount(_ reader: BufferReader) -> CanSendStoryCount? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
if _c1 {
|
||||
return Api.stories.CanSendStoryCount.canSendStoryCount(countRemains: _1!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api.stories {
|
||||
enum FoundStories: TypeConstructorDescription {
|
||||
case foundStories(flags: Int32, count: Int32, stories: [Api.FoundStory], nextOffset: String?, chats: [Api.Chat], users: [Api.User])
|
||||
@ -1560,55 +1596,3 @@ public extension Api.updates {
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api.updates {
|
||||
enum State: TypeConstructorDescription {
|
||||
case state(pts: Int32, qts: Int32, date: Int32, seq: Int32, unreadCount: Int32)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .state(let pts, let qts, let date, let seq, let unreadCount):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1519637954)
|
||||
}
|
||||
serializeInt32(pts, buffer: buffer, boxed: false)
|
||||
serializeInt32(qts, buffer: buffer, boxed: false)
|
||||
serializeInt32(date, buffer: buffer, boxed: false)
|
||||
serializeInt32(seq, buffer: buffer, boxed: false)
|
||||
serializeInt32(unreadCount, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .state(let pts, let qts, let date, let seq, let unreadCount):
|
||||
return ("state", [("pts", pts as Any), ("qts", qts as Any), ("date", date as Any), ("seq", seq as Any), ("unreadCount", unreadCount as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_state(_ reader: BufferReader) -> State? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Int32?
|
||||
_2 = reader.readInt32()
|
||||
var _3: Int32?
|
||||
_3 = reader.readInt32()
|
||||
var _4: Int32?
|
||||
_4 = reader.readInt32()
|
||||
var _5: Int32?
|
||||
_5 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
let _c4 = _4 != nil
|
||||
let _c5 = _5 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 {
|
||||
return Api.updates.State.state(pts: _1!, qts: _2!, date: _3!, seq: _4!, unreadCount: _5!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,55 @@
|
||||
public extension Api.updates {
|
||||
enum State: TypeConstructorDescription {
|
||||
case state(pts: Int32, qts: Int32, date: Int32, seq: Int32, unreadCount: Int32)
|
||||
|
||||
public func serialize(_ buffer: Buffer, _ boxed: Swift.Bool) {
|
||||
switch self {
|
||||
case .state(let pts, let qts, let date, let seq, let unreadCount):
|
||||
if boxed {
|
||||
buffer.appendInt32(-1519637954)
|
||||
}
|
||||
serializeInt32(pts, buffer: buffer, boxed: false)
|
||||
serializeInt32(qts, buffer: buffer, boxed: false)
|
||||
serializeInt32(date, buffer: buffer, boxed: false)
|
||||
serializeInt32(seq, buffer: buffer, boxed: false)
|
||||
serializeInt32(unreadCount, buffer: buffer, boxed: false)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
public func descriptionFields() -> (String, [(String, Any)]) {
|
||||
switch self {
|
||||
case .state(let pts, let qts, let date, let seq, let unreadCount):
|
||||
return ("state", [("pts", pts as Any), ("qts", qts as Any), ("date", date as Any), ("seq", seq as Any), ("unreadCount", unreadCount as Any)])
|
||||
}
|
||||
}
|
||||
|
||||
public static func parse_state(_ reader: BufferReader) -> State? {
|
||||
var _1: Int32?
|
||||
_1 = reader.readInt32()
|
||||
var _2: Int32?
|
||||
_2 = reader.readInt32()
|
||||
var _3: Int32?
|
||||
_3 = reader.readInt32()
|
||||
var _4: Int32?
|
||||
_4 = reader.readInt32()
|
||||
var _5: Int32?
|
||||
_5 = reader.readInt32()
|
||||
let _c1 = _1 != nil
|
||||
let _c2 = _2 != nil
|
||||
let _c3 = _3 != nil
|
||||
let _c4 = _4 != nil
|
||||
let _c5 = _5 != nil
|
||||
if _c1 && _c2 && _c3 && _c4 && _c5 {
|
||||
return Api.updates.State.state(pts: _1!, qts: _2!, date: _3!, seq: _4!, unreadCount: _5!)
|
||||
}
|
||||
else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public extension Api.upload {
|
||||
enum CdnFile: TypeConstructorDescription {
|
||||
case cdnFile(bytes: Buffer)
|
||||
|
@ -3590,6 +3590,22 @@ public extension Api.functions.channels {
|
||||
})
|
||||
}
|
||||
}
|
||||
public extension Api.functions.channels {
|
||||
static func toggleAutotranslation(channel: Api.InputChannel, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Updates>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(377471137)
|
||||
channel.serialize(buffer, true)
|
||||
enabled.serialize(buffer, true)
|
||||
return (FunctionDescription(name: "channels.toggleAutotranslation", parameters: [("channel", String(describing: channel)), ("enabled", String(describing: enabled))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.Updates?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.Updates
|
||||
}
|
||||
return result
|
||||
})
|
||||
}
|
||||
}
|
||||
public extension Api.functions.channels {
|
||||
static func toggleForum(channel: Api.InputChannel, enabled: Api.Bool) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Updates>) {
|
||||
let buffer = Buffer()
|
||||
@ -9791,12 +9807,12 @@ public extension Api.functions.payments {
|
||||
}
|
||||
}
|
||||
public extension Api.functions.payments {
|
||||
static func updateStarGiftPrice(slug: String, resellStars: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Updates>) {
|
||||
static func updateStarGiftPrice(stargift: Api.InputSavedStarGift, resellStars: Int64) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Updates>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-489360582)
|
||||
serializeString(slug, buffer: buffer, boxed: false)
|
||||
buffer.appendInt32(1001301217)
|
||||
stargift.serialize(buffer, true)
|
||||
serializeInt64(resellStars, buffer: buffer, boxed: false)
|
||||
return (FunctionDescription(name: "payments.updateStarGiftPrice", parameters: [("slug", String(describing: slug)), ("resellStars", String(describing: resellStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in
|
||||
return (FunctionDescription(name: "payments.updateStarGiftPrice", parameters: [("stargift", String(describing: stargift)), ("resellStars", String(describing: resellStars))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Updates? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.Updates?
|
||||
if let signature = reader.readInt32() {
|
||||
@ -11139,15 +11155,15 @@ public extension Api.functions.stories {
|
||||
}
|
||||
}
|
||||
public extension Api.functions.stories {
|
||||
static func canSendStory(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.Bool>) {
|
||||
static func canSendStory(peer: Api.InputPeer) -> (FunctionDescription, Buffer, DeserializeFunctionResponse<Api.stories.CanSendStoryCount>) {
|
||||
let buffer = Buffer()
|
||||
buffer.appendInt32(-941629475)
|
||||
buffer.appendInt32(820732912)
|
||||
peer.serialize(buffer, true)
|
||||
return (FunctionDescription(name: "stories.canSendStory", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.Bool? in
|
||||
return (FunctionDescription(name: "stories.canSendStory", parameters: [("peer", String(describing: peer))]), buffer, DeserializeFunctionResponse { (buffer: Buffer) -> Api.stories.CanSendStoryCount? in
|
||||
let reader = BufferReader(buffer)
|
||||
var result: Api.Bool?
|
||||
var result: Api.stories.CanSendStoryCount?
|
||||
if let signature = reader.readInt32() {
|
||||
result = Api.parse(reader, signature: signature) as? Api.Bool
|
||||
result = Api.parse(reader, signature: signature) as? Api.stories.CanSendStoryCount
|
||||
}
|
||||
return result
|
||||
})
|
||||
|
@ -7,6 +7,7 @@ swift_library(
|
||||
"Sources/**/*.swift",
|
||||
]),
|
||||
copts = [
|
||||
"-suppress-warnings",
|
||||
],
|
||||
deps = [
|
||||
],
|
||||
|
@ -163,7 +163,7 @@ objc_library(
|
||||
"PublicHeaders",
|
||||
],
|
||||
deps = [
|
||||
"//third-party/webrtc:webrtc_lib",
|
||||
"//third-party/webrtc:webrtc",
|
||||
"//submodules/MtProtoKit:MtProtoKit",
|
||||
"//third-party/boringssl:crypto",
|
||||
"//third-party/boringssl:ssl",
|
||||
|
17
submodules/ffmpeg/BUILD
vendored
17
submodules/ffmpeg/BUILD
vendored
@ -2,7 +2,6 @@
|
||||
ffmpeg_header_paths = [
|
||||
"libavutil/hwcontext.h",
|
||||
"libavutil/time.h",
|
||||
"libavutil/hwcontext_cuda.h",
|
||||
"libavutil/iamf.h",
|
||||
"libavutil/intfloat.h",
|
||||
"libavutil/error.h",
|
||||
@ -10,7 +9,6 @@ ffmpeg_header_paths = [
|
||||
"libavutil/ambient_viewing_environment.h",
|
||||
"libavutil/fifo.h",
|
||||
"libavutil/blowfish.h",
|
||||
"libavutil/hwcontext_mediacodec.h",
|
||||
"libavutil/replaygain.h",
|
||||
"libavutil/version.h",
|
||||
"libavutil/murmur3.h",
|
||||
@ -25,38 +23,30 @@ ffmpeg_header_paths = [
|
||||
"libavutil/avconfig.h",
|
||||
"libavutil/lfg.h",
|
||||
"libavutil/avutil.h",
|
||||
"libavutil/hwcontext_vulkan.h",
|
||||
"libavutil/xtea.h",
|
||||
"libavutil/crc.h",
|
||||
"libavutil/hwcontext_vdpau.h",
|
||||
"libavutil/frame.h",
|
||||
"libavutil/file.h",
|
||||
"libavutil/md5.h",
|
||||
"libavutil/cast5.h",
|
||||
"libavutil/hwcontext_vaapi.h",
|
||||
"libavutil/spherical.h",
|
||||
"libavutil/ffversion.h",
|
||||
"libavutil/hwcontext_opencl.h",
|
||||
"libavutil/audio_fifo.h",
|
||||
"libavutil/tree.h",
|
||||
"libavutil/threadmessage.h",
|
||||
"libavutil/attributes.h",
|
||||
"libavutil/hdr_dynamic_vivid_metadata.h",
|
||||
"libavutil/adler32.h",
|
||||
"libavutil/hwcontext_d3d11va.h",
|
||||
"libavutil/timecode.h",
|
||||
"libavutil/dovi_meta.h",
|
||||
"libavutil/hwcontext_d3d12va.h",
|
||||
"libavutil/tx.h",
|
||||
"libavutil/sha512.h",
|
||||
"libavutil/hwcontext_dxva2.h",
|
||||
"libavutil/display.h",
|
||||
"libavutil/buffer.h",
|
||||
"libavutil/camellia.h",
|
||||
"libavutil/csp.h",
|
||||
"libavutil/video_hint.h",
|
||||
"libavutil/pixelutils.h",
|
||||
"libavutil/hwcontext_drm.h",
|
||||
"libavutil/common.h",
|
||||
"libavutil/hmac.h",
|
||||
"libavutil/eval.h",
|
||||
@ -85,7 +75,6 @@ ffmpeg_header_paths = [
|
||||
"libavutil/ripemd.h",
|
||||
"libavutil/bprint.h",
|
||||
"libavutil/hdr_dynamic_metadata.h",
|
||||
"libavutil/hwcontext_qsv.h",
|
||||
"libavutil/pixfmt.h",
|
||||
"libavutil/aes_ctr.h",
|
||||
"libavutil/timestamp.h",
|
||||
@ -104,16 +93,11 @@ ffmpeg_header_paths = [
|
||||
"libavcodec/avcodec.h",
|
||||
"libavcodec/defs.h",
|
||||
"libavcodec/version.h",
|
||||
"libavcodec/vdpau.h",
|
||||
"libavcodec/codec_par.h",
|
||||
"libavcodec/qsv.h",
|
||||
"libavcodec/codec_desc.h",
|
||||
"libavcodec/videotoolbox.h",
|
||||
"libavcodec/mediacodec.h",
|
||||
"libavcodec/d3d11va.h",
|
||||
"libavcodec/avfft.h",
|
||||
"libavcodec/codec.h",
|
||||
"libavcodec/jni.h",
|
||||
"libavcodec/packet.h",
|
||||
"libavcodec/version_major.h",
|
||||
"libavcodec/bsf.h",
|
||||
@ -122,7 +106,6 @@ ffmpeg_header_paths = [
|
||||
"libavcodec/avdct.h",
|
||||
"libavcodec/ac3_parser.h",
|
||||
"libavcodec/vorbis_parser.h",
|
||||
"libavcodec/dxva2.h",
|
||||
"libavcodec/dv_profile.h",
|
||||
"libswresample/version.h",
|
||||
"libswresample/version_major.h",
|
||||
|
1
third-party/mozjpeg/BUILD
vendored
1
third-party/mozjpeg/BUILD
vendored
@ -87,7 +87,6 @@ objc_library(
|
||||
hdrs = [":Public/mozjpeg/" + x for x in headers] + [":Public/mozjpeg/jconfig.h"],
|
||||
includes = [
|
||||
"Public",
|
||||
"Public/mozjpeg",
|
||||
],
|
||||
deps = [
|
||||
":mozjpeg_lib",
|
||||
|
1
third-party/opus/BUILD
vendored
1
third-party/opus/BUILD
vendored
@ -70,7 +70,6 @@ objc_library(
|
||||
hdrs = [":Public/opus/" + x for x in headers],
|
||||
includes = [
|
||||
"Public",
|
||||
"Public/opus",
|
||||
],
|
||||
deps = [
|
||||
":opus_lib",
|
||||
|
@ -107,7 +107,7 @@ extern "C" {
|
||||
# include <stdarg.h>
|
||||
# include <stdio.h>
|
||||
# include <ogg/ogg.h>
|
||||
# include <opus_multistream.h>
|
||||
# include <opus/opus_multistream.h>
|
||||
|
||||
/**@cond PRIVATE*/
|
||||
|
||||
|
1
third-party/td/BUILD
vendored
1
third-party/td/BUILD
vendored
@ -109,7 +109,6 @@ objc_library(
|
||||
enable_modules = True,
|
||||
hdrs = [":Public/td/" + x for x in headers],
|
||||
includes = [
|
||||
"Public",
|
||||
"Public/td",
|
||||
],
|
||||
deps = [
|
||||
|
1
third-party/webp/BUILD
vendored
1
third-party/webp/BUILD
vendored
@ -84,7 +84,6 @@ objc_library(
|
||||
hdrs = [":Public/webp/" + x for x in headers],
|
||||
includes = [
|
||||
"Public",
|
||||
"Public/webp",
|
||||
],
|
||||
deps = [
|
||||
":webp_lib",
|
||||
|
2
third-party/webrtc/BUILD
vendored
2
third-party/webrtc/BUILD
vendored
@ -3563,7 +3563,7 @@ cc_library(
|
||||
)
|
||||
|
||||
objc_library(
|
||||
name = "webrtc_lib",
|
||||
name = "webrtc",
|
||||
enable_modules = True,
|
||||
module_name = "webrtc",
|
||||
srcs = combined_sources,
|
||||
|
Loading…
x
Reference in New Issue
Block a user