mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
Show "set a reminder" in media picker when scheduling in Saved Messages
This commit is contained in:
parent
d7006fdf3d
commit
45224e6e96
@ -32,6 +32,7 @@
|
|||||||
@property (nonatomic) bool disableStickers;
|
@property (nonatomic) bool disableStickers;
|
||||||
@property (nonatomic) bool hasSilentPosting;
|
@property (nonatomic) bool hasSilentPosting;
|
||||||
@property (nonatomic) bool hasSchedule;
|
@property (nonatomic) bool hasSchedule;
|
||||||
|
@property (nonatomic) bool reminder;
|
||||||
@property (nonatomic, copy) void (^presentScheduleController)(void (^)(int32_t));
|
@property (nonatomic, copy) void (^presentScheduleController)(void (^)(int32_t));
|
||||||
|
|
||||||
@property (nonatomic, strong) NSArray *underlyingViews;
|
@property (nonatomic, strong) NSArray *underlyingViews;
|
||||||
|
@ -801,7 +801,7 @@ const NSUInteger TGAttachmentDisplayedAssetLimit = 500;
|
|||||||
if ([cell isKindOfClass:[TGAttachmentAssetCell class]])
|
if ([cell isKindOfClass:[TGAttachmentAssetCell class]])
|
||||||
thumbnailImage = cell.imageView.image;
|
thumbnailImage = cell.imageView.image;
|
||||||
|
|
||||||
TGMediaPickerModernGalleryMixin *mixin = [[TGMediaPickerModernGalleryMixin alloc] initWithContext:_context item:asset fetchResult:_fetchResult parentController:self.parentController thumbnailImage:thumbnailImage selectionContext:_selectionContext editingContext:_editingContext suggestionContext:self.suggestionContext hasCaptions:(_allowCaptions && !_forProfilePhoto) allowCaptionEntities:self.allowCaptionEntities hasTimer:self.hasTimer onlyCrop:self.onlyCrop inhibitDocumentCaptions:_inhibitDocumentCaptions inhibitMute:self.inhibitMute asFile:self.asFile itemsLimit:TGAttachmentDisplayedAssetLimit recipientName:self.recipientName hasSilentPosting:self.hasSilentPosting hasSchedule:self.hasSchedule];
|
TGMediaPickerModernGalleryMixin *mixin = [[TGMediaPickerModernGalleryMixin alloc] initWithContext:_context item:asset fetchResult:_fetchResult parentController:self.parentController thumbnailImage:thumbnailImage selectionContext:_selectionContext editingContext:_editingContext suggestionContext:self.suggestionContext hasCaptions:(_allowCaptions && !_forProfilePhoto) allowCaptionEntities:self.allowCaptionEntities hasTimer:self.hasTimer onlyCrop:self.onlyCrop inhibitDocumentCaptions:_inhibitDocumentCaptions inhibitMute:self.inhibitMute asFile:self.asFile itemsLimit:TGAttachmentDisplayedAssetLimit recipientName:self.recipientName hasSilentPosting:self.hasSilentPosting hasSchedule:self.hasSchedule reminder:self.reminder];
|
||||||
mixin.presentScheduleController = self.presentScheduleController;
|
mixin.presentScheduleController = self.presentScheduleController;
|
||||||
__weak TGAttachmentCarouselItemView *weakSelf = self;
|
__weak TGAttachmentCarouselItemView *weakSelf = self;
|
||||||
mixin.thumbnailSignalForItem = ^SSignal *(id item)
|
mixin.thumbnailSignalForItem = ^SSignal *(id item)
|
||||||
|
@ -37,6 +37,7 @@ typedef enum {
|
|||||||
@property (nonatomic, assign) bool hasTimer;
|
@property (nonatomic, assign) bool hasTimer;
|
||||||
@property (nonatomic, assign) bool hasSilentPosting;
|
@property (nonatomic, assign) bool hasSilentPosting;
|
||||||
@property (nonatomic, assign) bool hasSchedule;
|
@property (nonatomic, assign) bool hasSchedule;
|
||||||
|
@property (nonatomic, assign) bool reminder;
|
||||||
@property (nonatomic, strong) TGSuggestionContext *suggestionContext;
|
@property (nonatomic, strong) TGSuggestionContext *suggestionContext;
|
||||||
@property (nonatomic, assign) bool shortcut;
|
@property (nonatomic, assign) bool shortcut;
|
||||||
|
|
||||||
|
@ -1279,7 +1279,7 @@ static CGPoint TGCameraControllerClampPointToScreenSize(__unused id self, __unus
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TGMediaPickerSendActionSheetController *controller = [[TGMediaPickerSendActionSheetController alloc] initWithContext:strongSelf->_context sendButtonFrame:strongModel.interfaceView.doneButtonFrame canSendSilently:strongSelf->_hasSilentPosting canSchedule:effectiveHasSchedule];
|
TGMediaPickerSendActionSheetController *controller = [[TGMediaPickerSendActionSheetController alloc] initWithContext:strongSelf->_context sendButtonFrame:strongModel.interfaceView.doneButtonFrame canSendSilently:strongSelf->_hasSilentPosting canSchedule:effectiveHasSchedule reminder:strongSelf->_reminder];
|
||||||
controller.send = ^{
|
controller.send = ^{
|
||||||
__strong TGCameraController *strongSelf = weakSelf;
|
__strong TGCameraController *strongSelf = weakSelf;
|
||||||
__strong TGMediaPickerGalleryModel *strongModel = weakModel;
|
__strong TGMediaPickerGalleryModel *strongModel = weakModel;
|
||||||
|
@ -59,6 +59,7 @@ typedef enum
|
|||||||
@property (nonatomic, assign) bool inhibitMute;
|
@property (nonatomic, assign) bool inhibitMute;
|
||||||
@property (nonatomic, assign) bool hasSilentPosting;
|
@property (nonatomic, assign) bool hasSilentPosting;
|
||||||
@property (nonatomic, assign) bool hasSchedule;
|
@property (nonatomic, assign) bool hasSchedule;
|
||||||
|
@property (nonatomic, assign) bool reminder;
|
||||||
@property (nonatomic, copy) void (^presentScheduleController)(void (^)(int32_t));
|
@property (nonatomic, copy) void (^presentScheduleController)(void (^)(int32_t));
|
||||||
|
|
||||||
@property (nonatomic, assign) bool liveVideoUploadEnabled;
|
@property (nonatomic, assign) bool liveVideoUploadEnabled;
|
||||||
|
@ -122,6 +122,7 @@
|
|||||||
pickerController.onlyCrop = strongController.onlyCrop;
|
pickerController.onlyCrop = strongController.onlyCrop;
|
||||||
pickerController.hasSilentPosting = strongController.hasSilentPosting;
|
pickerController.hasSilentPosting = strongController.hasSilentPosting;
|
||||||
pickerController.hasSchedule = strongController.hasSchedule;
|
pickerController.hasSchedule = strongController.hasSchedule;
|
||||||
|
pickerController.reminder = strongController.reminder;
|
||||||
pickerController.presentScheduleController = strongController.presentScheduleController;
|
pickerController.presentScheduleController = strongController.presentScheduleController;
|
||||||
[strongController pushViewController:pickerController animated:true];
|
[strongController pushViewController:pickerController animated:true];
|
||||||
};
|
};
|
||||||
@ -214,6 +215,12 @@
|
|||||||
self.pickerController.hasSchedule = hasSchedule;
|
self.pickerController.hasSchedule = hasSchedule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setReminder:(bool)reminder
|
||||||
|
{
|
||||||
|
_reminder = reminder;
|
||||||
|
self.pickerController.reminder = reminder;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)setPresentScheduleController:(void (^)(void (^)(int32_t)))presentScheduleController {
|
- (void)setPresentScheduleController:(void (^)(void (^)(int32_t)))presentScheduleController {
|
||||||
_presentScheduleController = [presentScheduleController copy];
|
_presentScheduleController = [presentScheduleController copy];
|
||||||
self.pickerController.presentScheduleController = presentScheduleController;
|
self.pickerController.presentScheduleController = presentScheduleController;
|
||||||
|
@ -323,7 +323,7 @@
|
|||||||
|
|
||||||
- (TGMediaPickerModernGalleryMixin *)_galleryMixinForContext:(id<LegacyComponentsContext>)context item:(id)item thumbnailImage:(UIImage *)thumbnailImage selectionContext:(TGMediaSelectionContext *)selectionContext editingContext:(TGMediaEditingContext *)editingContext suggestionContext:(TGSuggestionContext *)suggestionContext hasCaptions:(bool)hasCaptions allowCaptionEntities:(bool)allowCaptionEntities inhibitDocumentCaptions:(bool)inhibitDocumentCaptions asFile:(bool)asFile
|
- (TGMediaPickerModernGalleryMixin *)_galleryMixinForContext:(id<LegacyComponentsContext>)context item:(id)item thumbnailImage:(UIImage *)thumbnailImage selectionContext:(TGMediaSelectionContext *)selectionContext editingContext:(TGMediaEditingContext *)editingContext suggestionContext:(TGSuggestionContext *)suggestionContext hasCaptions:(bool)hasCaptions allowCaptionEntities:(bool)allowCaptionEntities inhibitDocumentCaptions:(bool)inhibitDocumentCaptions asFile:(bool)asFile
|
||||||
{
|
{
|
||||||
return [[TGMediaPickerModernGalleryMixin alloc] initWithContext:context item:item fetchResult:_fetchResult parentController:self thumbnailImage:thumbnailImage selectionContext:selectionContext editingContext:editingContext suggestionContext:suggestionContext hasCaptions:hasCaptions allowCaptionEntities:allowCaptionEntities hasTimer:self.hasTimer onlyCrop:self.onlyCrop inhibitDocumentCaptions:inhibitDocumentCaptions inhibitMute:self.inhibitMute asFile:asFile itemsLimit:0 recipientName:self.recipientName hasSilentPosting:self.hasSilentPosting hasSchedule:self.hasSchedule];
|
return [[TGMediaPickerModernGalleryMixin alloc] initWithContext:context item:item fetchResult:_fetchResult parentController:self thumbnailImage:thumbnailImage selectionContext:selectionContext editingContext:editingContext suggestionContext:suggestionContext hasCaptions:hasCaptions allowCaptionEntities:allowCaptionEntities hasTimer:self.hasTimer onlyCrop:self.onlyCrop inhibitDocumentCaptions:inhibitDocumentCaptions inhibitMute:self.inhibitMute asFile:asFile itemsLimit:0 recipientName:self.recipientName hasSilentPosting:self.hasSilentPosting hasSchedule:self.hasSchedule reminder:self.reminder];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (TGMediaPickerModernGalleryMixin *)galleryMixinForIndexPath:(NSIndexPath *)indexPath previewMode:(bool)previewMode outAsset:(TGMediaAsset **)outAsset
|
- (TGMediaPickerModernGalleryMixin *)galleryMixinForIndexPath:(NSIndexPath *)indexPath previewMode:(bool)previewMode outAsset:(TGMediaAsset **)outAsset
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
@property (nonatomic, strong) NSString *recipientName;
|
@property (nonatomic, strong) NSString *recipientName;
|
||||||
@property (nonatomic, assign) bool hasSilentPosting;
|
@property (nonatomic, assign) bool hasSilentPosting;
|
||||||
@property (nonatomic, assign) bool hasSchedule;
|
@property (nonatomic, assign) bool hasSchedule;
|
||||||
|
@property (nonatomic, assign) bool reminder;
|
||||||
@property (nonatomic, copy) void (^presentScheduleController)(void (^)(int32_t));
|
@property (nonatomic, copy) void (^presentScheduleController)(void (^)(int32_t));
|
||||||
|
|
||||||
@property (nonatomic, strong) TGMediaAssetsPallete *pallete;
|
@property (nonatomic, strong) TGMediaAssetsPallete *pallete;
|
||||||
|
@ -29,9 +29,9 @@
|
|||||||
|
|
||||||
@property (nonatomic, copy) void (^presentScheduleController)(void (^)(int32_t));
|
@property (nonatomic, copy) void (^presentScheduleController)(void (^)(int32_t));
|
||||||
|
|
||||||
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context item:(id)item fetchResult:(TGMediaAssetFetchResult *)fetchResult parentController:(TGViewController *)parentController thumbnailImage:(UIImage *)thumbnailImage selectionContext:(TGMediaSelectionContext *)selectionContext editingContext:(TGMediaEditingContext *)editingContext suggestionContext:(TGSuggestionContext *)suggestionContext hasCaptions:(bool)hasCaptions allowCaptionEntities:(bool)allowCaptionEntities hasTimer:(bool)hasTimer onlyCrop:(bool)onlyCrop inhibitDocumentCaptions:(bool)inhibitDocumentCaptions inhibitMute:(bool)inhibitMute asFile:(bool)asFile itemsLimit:(NSUInteger)itemsLimit recipientName:(NSString *)recipientName hasSilentPosting:(bool)hasSilentPosting hasSchedule:(bool)hasSchedule;
|
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context item:(id)item fetchResult:(TGMediaAssetFetchResult *)fetchResult parentController:(TGViewController *)parentController thumbnailImage:(UIImage *)thumbnailImage selectionContext:(TGMediaSelectionContext *)selectionContext editingContext:(TGMediaEditingContext *)editingContext suggestionContext:(TGSuggestionContext *)suggestionContext hasCaptions:(bool)hasCaptions allowCaptionEntities:(bool)allowCaptionEntities hasTimer:(bool)hasTimer onlyCrop:(bool)onlyCrop inhibitDocumentCaptions:(bool)inhibitDocumentCaptions inhibitMute:(bool)inhibitMute asFile:(bool)asFile itemsLimit:(NSUInteger)itemsLimit recipientName:(NSString *)recipientName hasSilentPosting:(bool)hasSilentPosting hasSchedule:(bool)hasSchedule reminder:(bool)reminder;
|
||||||
|
|
||||||
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context item:(id)item momentList:(TGMediaAssetMomentList *)momentList parentController:(TGViewController *)parentController thumbnailImage:(UIImage *)thumbnailImage selectionContext:(TGMediaSelectionContext *)selectionContext editingContext:(TGMediaEditingContext *)editingContext suggestionContext:(TGSuggestionContext *)suggestionContext hasCaptions:(bool)hasCaptions allowCaptionEntities:(bool)allowCaptionEntities hasTimer:(bool)hasTimer onlyCrop:(bool)onlyCrop inhibitDocumentCaptions:(bool)inhibitDocumentCaptions inhibitMute:(bool)inhibitMute asFile:(bool)asFile itemsLimit:(NSUInteger)itemsLimit hasSilentPosting:(bool)hasSilentPosting hasSchedule:(bool)hasSchedule;
|
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context item:(id)item momentList:(TGMediaAssetMomentList *)momentList parentController:(TGViewController *)parentController thumbnailImage:(UIImage *)thumbnailImage selectionContext:(TGMediaSelectionContext *)selectionContext editingContext:(TGMediaEditingContext *)editingContext suggestionContext:(TGSuggestionContext *)suggestionContext hasCaptions:(bool)hasCaptions allowCaptionEntities:(bool)allowCaptionEntities hasTimer:(bool)hasTimer onlyCrop:(bool)onlyCrop inhibitDocumentCaptions:(bool)inhibitDocumentCaptions inhibitMute:(bool)inhibitMute asFile:(bool)asFile itemsLimit:(NSUInteger)itemsLimit hasSilentPosting:(bool)hasSilentPosting hasSchedule:(bool)hasSchedule reminder:(bool)reminder;
|
||||||
|
|
||||||
- (void)present;
|
- (void)present;
|
||||||
- (void)updateWithFetchResult:(TGMediaAssetFetchResult *)fetchResult;
|
- (void)updateWithFetchResult:(TGMediaAssetFetchResult *)fetchResult;
|
||||||
|
@ -41,17 +41,17 @@
|
|||||||
|
|
||||||
@implementation TGMediaPickerModernGalleryMixin
|
@implementation TGMediaPickerModernGalleryMixin
|
||||||
|
|
||||||
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context item:(id)item fetchResult:(TGMediaAssetFetchResult *)fetchResult parentController:(TGViewController *)parentController thumbnailImage:(UIImage *)thumbnailImage selectionContext:(TGMediaSelectionContext *)selectionContext editingContext:(TGMediaEditingContext *)editingContext suggestionContext:(TGSuggestionContext *)suggestionContext hasCaptions:(bool)hasCaptions allowCaptionEntities:(bool)allowCaptionEntities hasTimer:(bool)hasTimer onlyCrop:(bool)onlyCrop inhibitDocumentCaptions:(bool)inhibitDocumentCaptions inhibitMute:(bool)inhibitMute asFile:(bool)asFile itemsLimit:(NSUInteger)itemsLimit recipientName:(NSString *)recipientName hasSilentPosting:(bool)hasSilentPosting hasSchedule:(bool)hasSchedule
|
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context item:(id)item fetchResult:(TGMediaAssetFetchResult *)fetchResult parentController:(TGViewController *)parentController thumbnailImage:(UIImage *)thumbnailImage selectionContext:(TGMediaSelectionContext *)selectionContext editingContext:(TGMediaEditingContext *)editingContext suggestionContext:(TGSuggestionContext *)suggestionContext hasCaptions:(bool)hasCaptions allowCaptionEntities:(bool)allowCaptionEntities hasTimer:(bool)hasTimer onlyCrop:(bool)onlyCrop inhibitDocumentCaptions:(bool)inhibitDocumentCaptions inhibitMute:(bool)inhibitMute asFile:(bool)asFile itemsLimit:(NSUInteger)itemsLimit recipientName:(NSString *)recipientName hasSilentPosting:(bool)hasSilentPosting hasSchedule:(bool)hasSchedule reminder:(bool)reminder
|
||||||
{
|
{
|
||||||
return [self initWithContext:context item:item fetchResult:fetchResult momentList:nil parentController:parentController thumbnailImage:thumbnailImage selectionContext:selectionContext editingContext:editingContext suggestionContext:suggestionContext hasCaptions:hasCaptions allowCaptionEntities:allowCaptionEntities hasTimer:hasTimer onlyCrop:onlyCrop inhibitDocumentCaptions:inhibitDocumentCaptions inhibitMute:inhibitMute asFile:asFile itemsLimit:itemsLimit recipientName:recipientName hasSilentPosting:hasSilentPosting hasSchedule:hasSchedule];
|
return [self initWithContext:context item:item fetchResult:fetchResult momentList:nil parentController:parentController thumbnailImage:thumbnailImage selectionContext:selectionContext editingContext:editingContext suggestionContext:suggestionContext hasCaptions:hasCaptions allowCaptionEntities:allowCaptionEntities hasTimer:hasTimer onlyCrop:onlyCrop inhibitDocumentCaptions:inhibitDocumentCaptions inhibitMute:inhibitMute asFile:asFile itemsLimit:itemsLimit recipientName:recipientName hasSilentPosting:hasSilentPosting hasSchedule:hasSchedule reminder:reminder];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context item:(id)item momentList:(TGMediaAssetMomentList *)momentList parentController:(TGViewController *)parentController thumbnailImage:(UIImage *)thumbnailImage selectionContext:(TGMediaSelectionContext *)selectionContext editingContext:(TGMediaEditingContext *)editingContext suggestionContext:(TGSuggestionContext *)suggestionContext hasCaptions:(bool)hasCaptions allowCaptionEntities:(bool)allowCaptionEntities hasTimer:(bool)hasTimer onlyCrop:(bool)onlyCrop inhibitDocumentCaptions:(bool)inhibitDocumentCaptions inhibitMute:(bool)inhibitMute asFile:(bool)asFile itemsLimit:(NSUInteger)itemsLimit hasSilentPosting:(bool)hasSilentPosting hasSchedule:(bool)hasSchedule
|
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context item:(id)item momentList:(TGMediaAssetMomentList *)momentList parentController:(TGViewController *)parentController thumbnailImage:(UIImage *)thumbnailImage selectionContext:(TGMediaSelectionContext *)selectionContext editingContext:(TGMediaEditingContext *)editingContext suggestionContext:(TGSuggestionContext *)suggestionContext hasCaptions:(bool)hasCaptions allowCaptionEntities:(bool)allowCaptionEntities hasTimer:(bool)hasTimer onlyCrop:(bool)onlyCrop inhibitDocumentCaptions:(bool)inhibitDocumentCaptions inhibitMute:(bool)inhibitMute asFile:(bool)asFile itemsLimit:(NSUInteger)itemsLimit hasSilentPosting:(bool)hasSilentPosting hasSchedule:(bool)hasSchedule reminder:(bool)reminder
|
||||||
{
|
{
|
||||||
return [self initWithContext:context item:item fetchResult:nil momentList:momentList parentController:parentController thumbnailImage:thumbnailImage selectionContext:selectionContext editingContext:editingContext suggestionContext:suggestionContext hasCaptions:hasCaptions allowCaptionEntities:allowCaptionEntities hasTimer:hasTimer onlyCrop:onlyCrop inhibitDocumentCaptions:inhibitDocumentCaptions inhibitMute:inhibitMute asFile:asFile itemsLimit:itemsLimit recipientName:nil hasSilentPosting:hasSilentPosting hasSchedule:hasSchedule];
|
return [self initWithContext:context item:item fetchResult:nil momentList:momentList parentController:parentController thumbnailImage:thumbnailImage selectionContext:selectionContext editingContext:editingContext suggestionContext:suggestionContext hasCaptions:hasCaptions allowCaptionEntities:allowCaptionEntities hasTimer:hasTimer onlyCrop:onlyCrop inhibitDocumentCaptions:inhibitDocumentCaptions inhibitMute:inhibitMute asFile:asFile itemsLimit:itemsLimit recipientName:nil hasSilentPosting:hasSilentPosting hasSchedule:hasSchedule reminder:reminder];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context item:(id)item fetchResult:(TGMediaAssetFetchResult *)fetchResult momentList:(TGMediaAssetMomentList *)momentList parentController:(TGViewController *)parentController thumbnailImage:(UIImage *)thumbnailImage selectionContext:(TGMediaSelectionContext *)selectionContext editingContext:(TGMediaEditingContext *)editingContext suggestionContext:(TGSuggestionContext *)suggestionContext hasCaptions:(bool)hasCaptions allowCaptionEntities:(bool)allowCaptionEntities hasTimer:(bool)hasTimer onlyCrop:(bool)onlyCrop inhibitDocumentCaptions:(bool)inhibitDocumentCaptions inhibitMute:(bool)inhibitMute asFile:(bool)asFile itemsLimit:(NSUInteger)itemsLimit recipientName:(NSString *)recipientName hasSilentPosting:(bool)hasSilentPosting hasSchedule:(bool)hasSchedule
|
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context item:(id)item fetchResult:(TGMediaAssetFetchResult *)fetchResult momentList:(TGMediaAssetMomentList *)momentList parentController:(TGViewController *)parentController thumbnailImage:(UIImage *)thumbnailImage selectionContext:(TGMediaSelectionContext *)selectionContext editingContext:(TGMediaEditingContext *)editingContext suggestionContext:(TGSuggestionContext *)suggestionContext hasCaptions:(bool)hasCaptions allowCaptionEntities:(bool)allowCaptionEntities hasTimer:(bool)hasTimer onlyCrop:(bool)onlyCrop inhibitDocumentCaptions:(bool)inhibitDocumentCaptions inhibitMute:(bool)inhibitMute asFile:(bool)asFile itemsLimit:(NSUInteger)itemsLimit recipientName:(NSString *)recipientName hasSilentPosting:(bool)hasSilentPosting hasSchedule:(bool)hasSchedule reminder:(bool)reminder
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self != nil)
|
if (self != nil)
|
||||||
@ -164,7 +164,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TGMediaPickerSendActionSheetController *controller = [[TGMediaPickerSendActionSheetController alloc] initWithContext:strongSelf->_context sendButtonFrame:strongSelf.galleryModel.interfaceView.doneButtonFrame canSendSilently:hasSilentPosting canSchedule:effectiveHasSchedule];
|
TGMediaPickerSendActionSheetController *controller = [[TGMediaPickerSendActionSheetController alloc] initWithContext:strongSelf->_context sendButtonFrame:strongSelf.galleryModel.interfaceView.doneButtonFrame canSendSilently:hasSilentPosting canSchedule:effectiveHasSchedule reminder:reminder];
|
||||||
controller.send = ^{
|
controller.send = ^{
|
||||||
__strong TGMediaPickerModernGalleryMixin *strongSelf = weakSelf;
|
__strong TGMediaPickerModernGalleryMixin *strongSelf = weakSelf;
|
||||||
if (strongSelf == nil)
|
if (strongSelf == nil)
|
||||||
|
@ -8,7 +8,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
@property (nonatomic, copy) void (^sendSilently)(void);
|
@property (nonatomic, copy) void (^sendSilently)(void);
|
||||||
@property (nonatomic, copy) void (^schedule)(void);
|
@property (nonatomic, copy) void (^schedule)(void);
|
||||||
|
|
||||||
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context sendButtonFrame:(CGRect)sendButtonFrame canSendSilently:(bool)canSendSilently canSchedule:(bool)canSchedule;
|
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context sendButtonFrame:(CGRect)sendButtonFrame canSendSilently:(bool)canSendSilently canSchedule:(bool)canSchedule reminder:(bool)reminder;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@ -76,6 +76,7 @@
|
|||||||
CGRect _sendButtonFrame;
|
CGRect _sendButtonFrame;
|
||||||
bool _canSendSilently;
|
bool _canSendSilently;
|
||||||
bool _canSchedule;
|
bool _canSchedule;
|
||||||
|
bool _reminder;
|
||||||
bool _autorotationWasEnabled;
|
bool _autorotationWasEnabled;
|
||||||
bool _dismissed;
|
bool _dismissed;
|
||||||
|
|
||||||
@ -91,13 +92,14 @@
|
|||||||
|
|
||||||
@implementation TGMediaPickerSendActionSheetController
|
@implementation TGMediaPickerSendActionSheetController
|
||||||
|
|
||||||
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context sendButtonFrame:(CGRect)sendButtonFrame canSendSilently:(bool)canSendSilently canSchedule:(bool)canSchedule {
|
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context sendButtonFrame:(CGRect)sendButtonFrame canSendSilently:(bool)canSendSilently canSchedule:(bool)canSchedule reminder:(bool)reminder {
|
||||||
self = [super initWithContext:context];
|
self = [super initWithContext:context];
|
||||||
if (self != nil) {
|
if (self != nil) {
|
||||||
_context = context;
|
_context = context;
|
||||||
_sendButtonFrame = sendButtonFrame;
|
_sendButtonFrame = sendButtonFrame;
|
||||||
_canSendSilently = canSendSilently;
|
_canSendSilently = canSendSilently;
|
||||||
_canSchedule = canSchedule;
|
_canSchedule = canSchedule;
|
||||||
|
_reminder = reminder;
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@ -128,7 +130,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_canSchedule) {
|
if (_canSchedule) {
|
||||||
_scheduleButton = [[TGMediaPickerSendActionSheetItemView alloc] initWithTitle:TGLocalized(@"Conversation.SendMessage.ScheduleMessage") icon:TGComponentsImageNamed(@"MediaSchedule")];
|
_scheduleButton = [[TGMediaPickerSendActionSheetItemView alloc] initWithTitle:TGLocalized(_reminder ? @"Conversation.SendMessage.SetReminder" : @"Conversation.SendMessage.ScheduleMessage") icon:TGComponentsImageNamed(@"MediaSchedule")];
|
||||||
_scheduleButton.pressed = ^{
|
_scheduleButton.pressed = ^{
|
||||||
__strong TGMediaPickerSendActionSheetController *strongSelf = weakSelf;
|
__strong TGMediaPickerSendActionSheetController *strongSelf = weakSelf;
|
||||||
[strongSelf schedulePressed];
|
[strongSelf schedulePressed];
|
||||||
|
@ -81,6 +81,7 @@ public func legacyAttachmentMenu(context: AccountContext, peer: Peer, editMediaO
|
|||||||
carouselItem.hasSilentPosting = !isSecretChat
|
carouselItem.hasSilentPosting = !isSecretChat
|
||||||
}
|
}
|
||||||
carouselItem.hasSchedule = hasSchedule
|
carouselItem.hasSchedule = hasSchedule
|
||||||
|
carouselItem.reminder = peer.id == context.account.peerId
|
||||||
carouselItem.presentScheduleController = { done in
|
carouselItem.presentScheduleController = { done in
|
||||||
presentSchedulePicker { time in
|
presentSchedulePicker { time in
|
||||||
done?(time)
|
done?(time)
|
||||||
|
@ -31,6 +31,7 @@ public func configureLegacyAssetPicker(_ controller: TGMediaAssetsController, co
|
|||||||
controller.hasSilentPosting = !isSecretChat
|
controller.hasSilentPosting = !isSecretChat
|
||||||
}
|
}
|
||||||
controller.hasSchedule = hasSchedule
|
controller.hasSchedule = hasSchedule
|
||||||
|
controller.reminder = peer.id == context.account.peerId
|
||||||
controller.presentScheduleController = { done in
|
controller.presentScheduleController = { done in
|
||||||
presentSchedulePicker { time in
|
presentSchedulePicker { time in
|
||||||
done?(time)
|
done?(time)
|
||||||
|
@ -530,7 +530,7 @@ public func updatedPresentationData(accountManager: AccountManager, applicationI
|
|||||||
|
|
||||||
if effectiveTheme != themeSettings.theme && themeSettings.themeSpecificChatWallpapers[effectiveTheme.index] == nil {
|
if effectiveTheme != themeSettings.theme && themeSettings.themeSpecificChatWallpapers[effectiveTheme.index] == nil {
|
||||||
switch effectiveChatWallpaper {
|
switch effectiveChatWallpaper {
|
||||||
case .builtin, .color:
|
case .builtin, .color, .gradient:
|
||||||
effectiveChatWallpaper = themeValue.chat.defaultWallpaper
|
effectiveChatWallpaper = themeValue.chat.defaultWallpaper
|
||||||
case let .file(file):
|
case let .file(file):
|
||||||
if file.isPattern {
|
if file.isPattern {
|
||||||
|
@ -376,7 +376,7 @@ final class ChatSendMessageActionSheetControllerNode: ViewControllerTracingNode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
let outgoing: PresentationThemeBubbleColorComponents = self.presentationData.chatWallpaper.isEmpty ? self.presentationData.theme.chat.message.outgoing.bubble.withoutWallpaper : self.presentationData.theme.chat.message.outgoing.bubble.withWallpaper
|
let outgoing: PresentationThemeBubbleColorComponents = self.presentationData.chatWallpaper.isEmpty ? self.presentationData.theme.chat.message.outgoing.bubble.withoutWallpaper : self.presentationData.theme.chat.message.outgoing.bubble.withWallpaper
|
||||||
self.messageBackgroundNode.image = messageBubbleImage(incoming: false, fillColor: outgoing.fill, strokeColor: outgoing.stroke, neighbors: .none, theme: self.presentationData.theme.chat, wallpaper: self.presentationData.chatWallpaper, knockout: false)
|
self.messageBackgroundNode.image = messageBubbleImage(incoming: false, fillColor: outgoing.gradientFill, strokeColor: outgoing.stroke, neighbors: .none, theme: self.presentationData.theme.chat, wallpaper: self.presentationData.chatWallpaper, knockout: false)
|
||||||
|
|
||||||
for node in self.contentNodes {
|
for node in self.contentNodes {
|
||||||
node.updateTheme(presentationData.theme)
|
node.updateTheme(presentationData.theme)
|
||||||
|
@ -73,6 +73,7 @@ func presentedLegacyCamera(context: AccountContext, peer: Peer, cameraView: TGAt
|
|||||||
controller.hasSilentPosting = !isSecretChat
|
controller.hasSilentPosting = !isSecretChat
|
||||||
}
|
}
|
||||||
controller.hasSchedule = hasSchedule
|
controller.hasSchedule = hasSchedule
|
||||||
|
controller.reminder = peer.id == context.account.peerId
|
||||||
|
|
||||||
let screenSize = parentController.view.bounds.size
|
let screenSize = parentController.view.bounds.size
|
||||||
var startFrame = CGRect(x: 0, y: screenSize.height, width: screenSize.width, height: screenSize.height)
|
var startFrame = CGRect(x: 0, y: screenSize.height, width: screenSize.width, height: screenSize.height)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user