show synced contacts in choose contact activity
This commit is contained in:
		
							parent
							
								
									3efb5b7f5c
								
							
						
					
					
						commit
						2c31fbae78
					
				| @ -4,7 +4,6 @@ import android.content.ContentValues; | ||||
| import android.content.Context; | ||||
| import android.database.Cursor; | ||||
| import android.net.Uri; | ||||
| import android.provider.ContactsContract; | ||||
| import android.support.annotation.NonNull; | ||||
| import android.text.TextUtils; | ||||
| 
 | ||||
| @ -22,7 +21,6 @@ import eu.siacs.conversations.Config; | ||||
| import eu.siacs.conversations.R; | ||||
| import eu.siacs.conversations.android.AbstractPhoneContact; | ||||
| import eu.siacs.conversations.android.JabberIdContact; | ||||
| import eu.siacs.conversations.android.PhoneNumberContact; | ||||
| import eu.siacs.conversations.utils.JidHelper; | ||||
| import eu.siacs.conversations.utils.UIHelper; | ||||
| import eu.siacs.conversations.xml.Element; | ||||
| @ -165,9 +163,6 @@ public class Contact implements ListItem, Blockable { | ||||
| 		if (isBlocked()) { | ||||
| 			tags.add(new Tag(context.getString(R.string.blocked), 0xff2e2f3b)); | ||||
| 		} | ||||
| 		if (showInPhoneBook()) { | ||||
| 			tags.add(new Tag(context.getString(R.string.phone_book), 0xFF1E88E5)); | ||||
| 		} | ||||
| 		return tags; | ||||
| 	} | ||||
| 
 | ||||
| @ -341,8 +336,8 @@ public class Contact implements ListItem, Blockable { | ||||
| 				|| (this.getOption(Contact.Options.DIRTY_PUSH)); | ||||
| 	} | ||||
| 
 | ||||
| 	public boolean showInPhoneBook() { | ||||
| 		return systemAccount != null; | ||||
| 	public boolean showInContactList() { | ||||
| 		return showInRoster() || getOption(Options.SYNCED_VIA_OTHER); | ||||
| 	} | ||||
| 
 | ||||
| 	public void parseSubscriptionFromElement(Element item) { | ||||
|  | ||||
| @ -929,9 +929,8 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl | ||||
| 		final Contact contact = getContact(); | ||||
| 		return mode == MODE_SINGLE | ||||
| 				&& !contact.isOwnServer() | ||||
| 				&& !contact.showInRoster() | ||||
| 				&& !contact.showInContactList() | ||||
| 				&& !contact.isSelf() | ||||
| 				&& !contact.showInPhoneBook() | ||||
| 				&& sentMessagesCount() == 0; | ||||
| 	} | ||||
| 
 | ||||
|  | ||||
| @ -660,7 +660,7 @@ public class Message extends AbstractEntity { | ||||
| 
 | ||||
| 	public boolean trusted() { | ||||
| 		Contact contact = this.getContact(); | ||||
| 		return status > STATUS_RECEIVED || (contact != null && (contact.showInRoster() || contact.isSelf())); | ||||
| 		return status > STATUS_RECEIVED || (contact != null && (contact.showInContactList() || contact.isSelf())); | ||||
| 	} | ||||
| 
 | ||||
| 	public boolean fixCounterpart() { | ||||
|  | ||||
| @ -263,7 +263,7 @@ public class ChooseContactActivity extends AbstractSearchableListItemActivity im | ||||
|         for (final Account account : xmppConnectionService.getAccounts()) { | ||||
|             if (account.getStatus() != Account.State.DISABLED) { | ||||
|                 for (final Contact contact : account.getRoster().getContacts()) { | ||||
|                     if (contact.showInRoster() && | ||||
|                     if (contact.showInContactList() && | ||||
|                             !filterContacts.contains(contact.getJid().asBareJid().toString()) | ||||
|                             && contact.match(this, needle)) { | ||||
|                         getListItems().add(contact); | ||||
|  | ||||
| @ -860,12 +860,11 @@ public class StartConversationActivity extends XmppActivity implements XmppConne | ||||
| 	protected void filterContacts(String needle) { | ||||
| 		this.contacts.clear(); | ||||
| 		final List<Account> accounts = xmppConnectionService.getAccounts(); | ||||
| 		final boolean singleAccountActive = isSingleAccountActive(accounts); | ||||
| 		for (Account account : accounts) { | ||||
| 			if (account.getStatus() != Account.State.DISABLED) { | ||||
| 				for (Contact contact : account.getRoster().getContacts()) { | ||||
| 					Presence.Status s = contact.getShownStatus(); | ||||
| 					if ((contact.showInRoster() || (singleAccountActive && contact.showInPhoneBook())) && contact.match(this, needle) | ||||
| 					if (contact.showInContactList() && contact.match(this, needle) | ||||
| 							&& (!this.mHideOfflineContacts | ||||
| 							|| (needle != null && !needle.trim().isEmpty()) | ||||
| 							|| s.compareTo(Presence.Status.OFFLINE) < 0)) { | ||||
|  | ||||
| @ -725,7 +725,6 @@ | ||||
|     <string name="providing_a_name_is_optional">Providing a name is optional</string> | ||||
|     <string name="create_dialog_group_chat_name">Group chat name</string> | ||||
|     <string name="conference_destroyed">This group chat has been destroyed</string> | ||||
|     <string name="phone_book">Address book</string> | ||||
|     <string name="unable_to_save_recording">Unable to save recording</string> | ||||
|     <string name="foreground_service_channel_name">Foreground service</string> | ||||
|     <string name="foreground_service_channel_description">This notification category is used to display a permanent notification indicating that Conversations is running.</string> | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Daniel Gultsch
						Daniel Gultsch