@ -4,7 +4,6 @@
// • M e n t i o n s
// • M e n t i o n s
// • R e m a i n i n g s e n d l o g i c
// • R e m a i n i n g s e n d l o g i c
// • S u b t i t l e
// • S u b t i t l e
// • R e s e n d i n g f a i l e d m e s s a g e s
// • S l i g h t p a g i n g g l i t c h
// • S l i g h t p a g i n g g l i t c h
// • S c r o l l i n g b u g
// • S c r o l l i n g b u g
// • S c r o l l b u t t o n b u g
// • S c r o l l b u t t o n b u g
@ -362,6 +361,33 @@ final class ConversationVC : BaseVC, ConversationViewModelDelegate, UITableViewD
present ( linkPreviewModel , animated : true , completion : nil )
present ( linkPreviewModel , animated : true , completion : nil )
}
}
func showFailedMessageSheet ( for tsMessage : TSOutgoingMessage ) {
let thread = self . thread
let sheet = UIAlertController ( title : tsMessage . mostRecentFailureText , message : nil , preferredStyle : . actionSheet )
sheet . addAction ( UIAlertAction ( title : " Cancel " , style : . cancel , handler : nil ) )
sheet . addAction ( UIAlertAction ( title : " Delete " , style : . destructive , handler : { _ in
Storage . write { transaction in
tsMessage . remove ( with : transaction )
Storage . shared . cancelPendingMessageSendJobIfNeeded ( for : tsMessage . timestamp , using : transaction )
}
} ) )
sheet . addAction ( UIAlertAction ( title : " Resend " , style : . default , handler : { _ in
let message = VisibleMessage . from ( tsMessage )
Storage . write { transaction in
var attachments : [ TSAttachmentStream ] = [ ]
tsMessage . attachmentIds . forEach { attachmentID in
guard let attachmentID = attachmentID as ? String else { return }
let attachment = TSAttachment . fetch ( uniqueId : attachmentID , transaction : transaction )
guard let stream = attachment as ? TSAttachmentStream else { return }
attachments . append ( stream )
}
MessageSender . prep ( attachments , for : message , using : transaction )
MessageSender . send ( message , in : thread , using : transaction )
}
} ) )
present ( sheet , animated : true , completion : nil )
}
// MARK: C o n v e n i e n c e
// MARK: C o n v e n i e n c e
private func getTitle ( ) -> String {
private func getTitle ( ) -> String {
if let thread = thread as ? TSGroupThread {
if let thread = thread as ? TSGroupThread {