|  |  | @ -560,6 +560,10 @@ NS_ASSUME_NONNULL_BEGIN | 
			
		
	
		
		
			
				
					
					|  |  |  |     __block TSIncomingMessage *_Nullable incomingMessage; |  |  |  |     __block TSIncomingMessage *_Nullable incomingMessage; | 
			
		
	
		
		
			
				
					
					|  |  |  |     __block TSThread *thread; |  |  |  |     __block TSThread *thread; | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     // Do this outside of a transaction to avoid deadlock | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     OWSAssert([TSAccountManager isRegistered]); | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     NSString *localNumber = [TSAccountManager localNumber]; | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |     [self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { |  |  |  |     [self.dbConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) { | 
			
		
	
		
		
			
				
					
					|  |  |  |       if (groupId) { |  |  |  |       if (groupId) { | 
			
		
	
		
		
			
				
					
					|  |  |  |           NSMutableArray *uniqueMemberIds = [[[NSSet setWithArray:dataMessage.group.members] allObjects] mutableCopy]; |  |  |  |           NSMutableArray *uniqueMemberIds = [[[NSSet setWithArray:dataMessage.group.members] allObjects] mutableCopy]; | 
			
		
	
	
		
		
			
				
					|  |  | @ -634,8 +638,7 @@ NS_ASSUME_NONNULL_BEGIN | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |           // Any messages sent from the current user - from this device or another - should be |  |  |  |           // Any messages sent from the current user - from this device or another - should be | 
			
		
	
		
		
			
				
					
					|  |  |  |           // automatically marked as read. |  |  |  |           // automatically marked as read. | 
			
		
	
		
		
			
				
					
					|  |  |  |           OWSAssert([TSAccountManager isRegistered]); |  |  |  |           BOOL shouldMarkMessageAsRead = [envelope.source isEqualToString:localNumber]; | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |           BOOL shouldMarkMessageAsRead = [envelope.source isEqualToString:[TSAccountManager localNumber]]; |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |           if (shouldMarkMessageAsRead) { |  |  |  |           if (shouldMarkMessageAsRead) { | 
			
		
	
		
		
			
				
					
					|  |  |  |               [incomingMessage markAsReadLocallyWithTransaction:transaction]; |  |  |  |               [incomingMessage markAsReadLocallyWithTransaction:transaction]; | 
			
		
	
		
		
			
				
					
					|  |  |  |           } |  |  |  |           } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |