Merge branch 'charlesmchen/approveGIFs' into release/2.18.2

pull/1/head
Matthew Chen 8 years ago
commit 00752c17a2

@ -3226,15 +3226,13 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) {
#pragma mark GifPickerViewControllerDelegate
- (void)gifPickerWillSend
- (void)gifPickerDidSelectWithAttachment:(SignalAttachment *)attachment
{
[ThreadUtil addThreadToProfileWhitelistIfEmptyContactThread:self.thread];
}
OWSAssert(attachment);
- (void)gifPickerDidSendWithOutgoingMessage:(TSOutgoingMessage *)message
{
[self messageWasSent:message];
[self tryToSendAttachmentIfApproved:attachment];
[ThreadUtil addThreadToProfileWhitelistIfEmptyContactThread:self.thread];
[self ensureDynamicInteractions];
}

@ -6,8 +6,7 @@ import Foundation
@objc
protocol GifPickerViewControllerDelegate: class {
func gifPickerWillSend()
func gifPickerDidSend(outgoingMessage: TSOutgoingMessage)
func gifPickerDidSelect(attachment: SignalAttachment)
}
class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollectionViewDataSource, UICollectionViewDelegate, GifPickerLayoutDelegate {
@ -363,13 +362,9 @@ class GifPickerViewController: OWSViewController, UISearchBarDelegate, UICollect
}
let attachment = SignalAttachment(dataSource: dataSource, dataUTI: asset.rendition.utiType)
strongSelf.delegate?.gifPickerWillSend()
let outgoingMessage = ThreadUtil.sendMessage(with: attachment, in: strongSelf.thread, messageSender: strongSelf.messageSender)
strongSelf.delegate?.gifPickerDidSend(outgoingMessage: outgoingMessage)
strongSelf.dismiss(animated: true, completion: nil)
strongSelf.dismiss(animated: true, completion: {
strongSelf.delegate?.gifPickerDidSelect(attachment: attachment)
})
}.catch { [weak self] error in
guard let strongSelf = self else {
Logger.info("\(GifPickerViewController.TAG) ignoring failure, since VC was dismissed before fetching finished.")

Loading…
Cancel
Save