mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
- Sends image rotated - If message is delete, delete the attachment db object and file - Delete attachment from detail view
50 lines
1.6 KiB
Objective-C
50 lines
1.6 KiB
Objective-C
//
|
|
// JSQMessagesCollectionViewCell+menuBarItems.m
|
|
// Signal
|
|
//
|
|
// Created by Frederic Jacobs on 26/12/14.
|
|
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
|
|
//
|
|
|
|
#import "JSQMessagesCollectionViewCell+menuBarItems.h"
|
|
|
|
@implementation JSQMessagesCollectionViewCell (menuBarItems)
|
|
|
|
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
|
|
{
|
|
if (action == @selector(delete:)) {
|
|
return YES;
|
|
}
|
|
|
|
return [super canPerformAction:action withSender:sender];
|
|
}
|
|
|
|
- (void)delete:(id)sender
|
|
{
|
|
[self performSelectorOnParentCollectionView:@selector(delete:)
|
|
withSender:sender];
|
|
}
|
|
|
|
- (void)performSelectorOnParentCollectionView:(SEL)selector
|
|
withSender:(id)sender {
|
|
UIView *view = self;
|
|
do {
|
|
view = view.superview;
|
|
} while (![view isKindOfClass:[UICollectionView class]]);
|
|
UICollectionView *collectionView = (UICollectionView *)view;
|
|
NSIndexPath *indexPath = [collectionView indexPathForCell:self];
|
|
|
|
if (collectionView.delegate &&
|
|
[collectionView.delegate respondsToSelector:@selector(collectionView:
|
|
performAction:
|
|
forItemAtIndexPath:
|
|
withSender:)])
|
|
|
|
[collectionView.delegate collectionView:collectionView
|
|
performAction:selector
|
|
forItemAtIndexPath:indexPath
|
|
withSender:sender];
|
|
}
|
|
|
|
@end
|