@@ -49,7 +49,7 @@ use types::chat::FullChat;
49
49
use types:: contact:: { ContactObject , VcardContact } ;
50
50
use types:: events:: Event ;
51
51
use types:: http:: HttpResponse ;
52
- use types:: message:: { MessageData , MessageObject , MessageReadReceipt } ;
52
+ use types:: message:: { LateFilingMediaSize , MessageData , MessageObject , MessageReadReceipt } ;
53
53
use types:: provider_info:: ProviderInfo ;
54
54
use types:: reactions:: JSONRPCReactions ;
55
55
use types:: webxdc:: WebxdcMessageInfo ;
@@ -1262,6 +1262,31 @@ impl CommandApi {
1262
1262
MsgId :: new ( message_id) . download_full ( & ctx) . await
1263
1263
}
1264
1264
1265
+ /// Late filing information to a message.
1266
+ /// Changes the message width, height or duration, and stores it into the database.
1267
+ ///
1268
+ /// Sometimes, the core cannot find out the width, the height or the duration
1269
+ /// of an image, an audio or a video.
1270
+ ///
1271
+ /// If, in these cases, the frontend can provide the information, it can save
1272
+ /// them together with the message object for later usage.
1273
+ ///
1274
+ /// This function should only be used if `Message.dimensions_width`, `Message.dimensions_height` or `Message.duration`
1275
+ /// do not provide the expected values.
1276
+ ///
1277
+ /// To get the stored values later, use `Message.dimensions_width`, `Message.dimensions_height` or `Message.duration`.
1278
+ async fn late_file_message_mediasize (
1279
+ & self ,
1280
+ account_id : u32 ,
1281
+ message_id : u32 ,
1282
+ new_size : LateFilingMediaSize ,
1283
+ ) -> Result < ( ) > {
1284
+ let ctx = self . get_context ( account_id) . await ?;
1285
+ new_size
1286
+ . apply_to_message ( & ctx, MsgId :: new ( message_id) )
1287
+ . await
1288
+ }
1289
+
1265
1290
/// Search messages containing the given query string.
1266
1291
/// Searching can be done globally (chat_id=None) or in a specified chat only (chat_id set).
1267
1292
///
0 commit comments