Add Send When Online shortcut

This commit is contained in:
Ilya Laktyushin
2023-03-09 20:03:26 +04:00
parent 838c352971
commit 656a0247fc
42 changed files with 1160 additions and 182 deletions

View File

@@ -776,7 +776,7 @@ typedef enum
[_generator impactOccurred];
}
TGMediaPickerSendActionSheetController *controller = [[TGMediaPickerSendActionSheetController alloc] initWithContext:_context isDark:self.pallete.isDark sendButtonFrame:[_controlsView convertRect:[_controlsView frameForSendButton] toView:nil] canSendSilently:_canSendSilently canSchedule:_canSchedule reminder:_reminder hasTimer:false];
TGMediaPickerSendActionSheetController *controller = [[TGMediaPickerSendActionSheetController alloc] initWithContext:_context isDark:self.pallete.isDark sendButtonFrame:[_controlsView convertRect:[_controlsView frameForSendButton] toView:nil] canSendSilently:_canSendSilently canSendWhenOnline:false canSchedule:_canSchedule reminder:_reminder hasTimer:false];
__weak TGVideoMessageCaptureController *weakSelf = self;
controller.send = ^{
__strong TGVideoMessageCaptureController *strongSelf = weakSelf;
@@ -800,6 +800,17 @@ typedef enum
_automaticDismiss = true;
[strongSelf dismiss:false];
};
controller.sendWhenOnline = ^{
__strong TGVideoMessageCaptureController *strongSelf = weakSelf;
if (strongSelf == nil) {
return;
}
[strongSelf finishWithURL:strongSelf->_url dimensions:CGSizeMake(240.0f, 240.0f) duration:strongSelf->_duration liveUploadData:strongSelf->_liveUploadData thumbnailImage:strongSelf->_thumbnailImage isSilent:false scheduleTimestamp:0x7ffffffe];
_automaticDismiss = true;
[strongSelf dismiss:false];
};
controller.schedule = ^{
__strong TGVideoMessageCaptureController *strongSelf = weakSelf;
if (strongSelf == nil) {