hi every one what is what is inputFileGenerated and what's it usage?
It should be used whenever not yet existed file needs to be sent. For example,
To achieve that the client specifies two pretty arbitrary strings original_path and conversion and should be able to generate the file based on value of these parameters whenever it receives updateFileGenerationStart.
For example, a client can use for the mentioned cases:
original_path and "compress_photo" as conversion.original_path and "compress_video" as conversion.original_path and "download" as conversion.original_path and "record_voice" as conversion.original_path and "copy" as conversion.There are a lot of more complex cases when inputFileGenerated can be used. Basically all cases except sending a local/already sent file should be covered by inputFileGenerated.
tanks
is there any list of conversions? Or should dev implement each?
There is no built-in conversions except "#url#" used for files, which need to de downloaded from an HTTP/HTTPS URL. But even that conversion needs to be handled and implemented by the client.
Also, all conversions beginning with '#' are reserved for internal TDLib usage.
How to register conversion so tdlib can know which method to call?
Should I use updateFileGenerationStart and updateFileGenerationStop as wrapper?
You must handle updateFileGenerationStart and updateFileGenerationStop updates from TDLib, and then provide progress about the generation using setFileGenerationProgress and finishFileGeneration.
Since TDLib 1.4.0 you can also use the method writeGeneratedFilePart if you have no direct access to TDLib's file system.
Most helpful comment
It should be used whenever not yet existed file needs to be sent. For example,
To achieve that the client specifies two pretty arbitrary strings
original_pathandconversionand should be able to generate the file based on value of these parameters whenever it receivesupdateFileGenerationStart.For example, a client can use for the mentioned cases:
original_pathand "compress_photo" as conversion.original_pathand "compress_video" as conversion.original_pathand "download" as conversion.original_pathand "record_voice" as conversion.original_pathand "copy" as conversion.There are a lot of more complex cases when inputFileGenerated can be used. Basically all cases except sending a local/already sent file should be covered by inputFileGenerated.