@@ -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 ;
@@ -1248,6 +1248,31 @@ impl CommandApi {
1248
1248
MsgId :: new ( message_id) . download_full ( & ctx) . await
1249
1249
}
1250
1250
1251
+ /// Late filing information to a message.
1252
+ /// Changes the message width, height or duration, and stores it into the database.
1253
+ ///
1254
+ /// Sometimes, the core cannot find out the width, the height or the duration
1255
+ /// of an image, an audio or a video.
1256
+ ///
1257
+ /// If, in these cases, the frontend can provide the information, it can save
1258
+ /// them together with the message object for later usage.
1259
+ ///
1260
+ /// This function should only be used if `Message.dimensions_width`, `Message.dimensions_height` or `Message.duration`
1261
+ /// do not provide the expected values.
1262
+ ///
1263
+ /// To get the stored values later, use `Message.dimensions_width`, `Message.dimensions_height` or `Message.duration`.
1264
+ async fn late_file_message_mediasize (
1265
+ & self ,
1266
+ account_id : u32 ,
1267
+ message_id : u32 ,
1268
+ new_size : LateFilingMediaSize ,
1269
+ ) -> Result < ( ) > {
1270
+ let ctx = self . get_context ( account_id) . await ?;
1271
+ new_size
1272
+ . apply_to_message ( & ctx, MsgId :: new ( message_id) )
1273
+ . await
1274
+ }
1275
+
1251
1276
/// Search messages containing the given query string.
1252
1277
/// Searching can be done globally (chat_id=None) or in a specified chat only (chat_id set).
1253
1278
///
0 commit comments