|  |  | @ -947,7 +947,7 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations | 
			
		
	
		
		
			
				
					
					|  |  |  |     }); |  |  |  |     }); | 
			
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | #pragma mark Table Swipe to Delete |  |  |  | #pragma mark - Edit Actions | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | - (void)tableView:(UITableView *)tableView |  |  |  | - (void)tableView:(UITableView *)tableView | 
			
		
	
		
		
			
				
					
					|  |  |  |     commitEditingStyle:(UITableViewCellEditingStyle)editingStyle |  |  |  |     commitEditingStyle:(UITableViewCellEditingStyle)editingStyle | 
			
		
	
	
		
		
			
				
					|  |  | @ -992,7 +992,11 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations | 
			
		
	
		
		
			
				
					
					|  |  |  |                                }]; |  |  |  |                                }]; | 
			
		
	
		
		
			
				
					
					|  |  |  |             } |  |  |  |             } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |             return @[ deleteAction, archiveAction ]; |  |  |  |             // The first action will be auto-performed for "very long swipes". | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             return @[ | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 archiveAction, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |                 deleteAction, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             ]; | 
			
		
	
		
		
			
				
					
					|  |  |  |         } |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |         case HomeViewControllerSectionArchiveButton: { |  |  |  |         case HomeViewControllerSectionArchiveButton: { | 
			
		
	
		
		
			
				
					
					|  |  |  |             return @[]; |  |  |  |             return @[]; | 
			
		
	
	
		
		
			
				
					|  |  | @ -1113,22 +1117,21 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     TSThread *thread = [self threadForIndexPath:indexPath]; |  |  |  |     TSThread *thread = [self threadForIndexPath:indexPath]; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     if (![thread isKindOfClass:[TSGroupThread class]]) { |  |  |  |     __weak HomeViewController *weakSelf = self; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         [self deleteThread:thread]; |  |  |  |     UIAlertController *alert = | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         return; |  |  |  |         [UIAlertController alertControllerWithTitle:NSLocalizedString(@"CONVERSATION_DELETE_CONFIRMATION_ALERT_TITLE", | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |                                                         @"Title for the 'conversation delete confirmation' alert.") | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |                                             message:NSLocalizedString(@"CONVERSATION_DELETE_CONFIRMATION_ALERT_MESSAGE", | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     TSGroupThread *gThread = (TSGroupThread *)thread; |  |  |  |                                                         @"Message for the 'conversation delete confirmation' alert.") | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     if (![gThread.groupModel.groupMemberIds containsObject:[TSAccountManager localNumber]]) { |  |  |  |                                      preferredStyle:UIAlertControllerStyleAlert]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         [self deleteThread:thread]; |  |  |  |     [alert addAction:[UIAlertAction actionWithTitle:NSLocalizedString(@"TXT_DELETE_TITLE", nil) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         return; |  |  |  |                                               style:UIAlertActionStyleDestructive | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |                                             handler:^(UIAlertAction *action) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |                                                 [weakSelf deleteThread:thread]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     [ThreadUtil enqueueLeaveGroupMessageInThread:gThread]; |  |  |  |                                             }]]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  |     [alert addAction:[OWSAlerts cancelAction]]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     // MJK TODO - DURABLE TESTPLAN is this safe to delete the gThread when the outgoing message hasn't completed |  |  |  | 
 | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     // sending? |  |  |  |     [self presentViewController:alert animated:YES completion:nil]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |     [self deleteThread:thread]; |  |  |  |  | 
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | } |  |  |  | } | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  | - (void)deleteThread:(TSThread *)thread |  |  |  | - (void)deleteThread:(TSThread *)thread | 
			
		
	
	
		
		
			
				
					|  |  | 
 |