| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -345,23 +345,21 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    }
 | 
					 | 
					 | 
					 | 
					                    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if (!matched && criteria.in_subject) {
 | 
					 | 
					 | 
					 | 
					                    if (!matched && criteria.in_subject) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        if (message.subject != null &&
 | 
					 | 
					 | 
					 | 
					                        if (contains(message.subject, query))
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                message.subject.toLowerCase().contains(query))
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                            matched = true;
 | 
					 | 
					 | 
					 | 
					                            matched = true;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    }
 | 
					 | 
					 | 
					 | 
					                    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if (!matched && criteria.in_keywords) {
 | 
					 | 
					 | 
					 | 
					                    if (!matched && criteria.in_keywords) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        if (message.keywords != null)
 | 
					 | 
					 | 
					 | 
					                        if (message.keywords != null)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                            for (String keyword : message.keywords)
 | 
					 | 
					 | 
					 | 
					                            for (String keyword : message.keywords)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                if (keyword.toLowerCase().contains(query)) {
 | 
					 | 
					 | 
					 | 
					                                if (contains(keyword, query)) {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                    matched = true;
 | 
					 | 
					 | 
					 | 
					                                    matched = true;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                    break;
 | 
					 | 
					 | 
					 | 
					                                    break;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                }
 | 
					 | 
					 | 
					 | 
					                                }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    }
 | 
					 | 
					 | 
					 | 
					                    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if (!matched && criteria.in_notes) {
 | 
					 | 
					 | 
					 | 
					                    if (!matched && criteria.in_notes) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        if (message.notes != null &&
 | 
					 | 
					 | 
					 | 
					                        if (contains(message.notes, query))
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                message.notes.toLowerCase().contains(query))
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                            matched = true;
 | 
					 | 
					 | 
					 | 
					                            matched = true;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    }
 | 
					 | 
					 | 
					 | 
					                    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -370,10 +368,9 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                            File file = EntityMessage.getFile(context, id);
 | 
					 | 
					 | 
					 | 
					                            File file = EntityMessage.getFile(context, id);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                            if (file.exists()) {
 | 
					 | 
					 | 
					 | 
					                            if (file.exists()) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                String html = Helper.readText(file);
 | 
					 | 
					 | 
					 | 
					                                String html = Helper.readText(file);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                if (html.toLowerCase().contains(query)) {
 | 
					 | 
					 | 
					 | 
					                                if (contains(html, query)) {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                    String text = HtmlHelper.getFullText(html);
 | 
					 | 
					 | 
					 | 
					                                    String text = HtmlHelper.getFullText(html);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                    if (text != null &&
 | 
					 | 
					 | 
					 | 
					                                    if (contains(text, query))
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                            text.toLowerCase().contains(query))
 | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                        matched = true;
 | 
					 | 
					 | 
					 | 
					                                        matched = true;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                                }
 | 
					 | 
					 | 
					 | 
					                                }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                            }
 | 
					 | 
					 | 
					 | 
					                            }
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -782,15 +779,26 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return imessages;
 | 
					 | 
					 | 
					 | 
					        return imessages;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    private static boolean contains(Address[] addresses, String text) {
 | 
					 | 
					 | 
					 | 
					    private static boolean contains(Address[] addresses, String query) {
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        if (addresses == null)
 | 
					 | 
					 | 
					 | 
					        if (addresses == null)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            return false;
 | 
					 | 
					 | 
					 | 
					            return false;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        for (Address address : addresses)
 | 
					 | 
					 | 
					 | 
					        for (Address address : addresses)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if (address.toString().toLowerCase().contains(text))
 | 
					 | 
					 | 
					 | 
					            if (contains(address.toString(), query))
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                return true;
 | 
					 | 
					 | 
					 | 
					                return true;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return false;
 | 
					 | 
					 | 
					 | 
					        return false;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    private static boolean contains(String text, String query) {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (TextUtils.isEmpty(text))
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            return false;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        text = text.toLowerCase();
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (text.contains(query))
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            return true;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        String normalized = Normalizer.normalize(text, Normalizer.Form.NFKD)
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                .replaceAll("[\\p{InCombiningDiacriticalMarks}]", "");
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					        return normalized.contains(query);
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    State getState() {
 | 
					 | 
					 | 
					 | 
					    State getState() {
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					        return this.state;
 | 
					 | 
					 | 
					 | 
					        return this.state;
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    }
 | 
					 | 
					 | 
					 | 
					    }
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
 
 |