mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
streamline parameter order
This commit is contained in:
@@ -279,12 +279,14 @@ public class ContactSelectionListFragment extends Fragment
|
||||
@Override
|
||||
public Loader<DcContactsLoader.Ret> onCreateLoader(int id, Bundle args) {
|
||||
boolean allowCreation = getActivity().getIntent().getBooleanExtra(ALLOW_CREATION, true);
|
||||
boolean addCreateContactLink = allowCreation;
|
||||
boolean addCreateGroupLinks = allowCreation && !isRelayingMessageContent(getActivity()) && !isMulti();
|
||||
|
||||
int listflags = DcContext.DC_GCL_ADD_SELF;
|
||||
if(isSelectVerfied()) {
|
||||
listflags = DcContext.DC_GCL_VERIFIED_ONLY;
|
||||
}
|
||||
return new DcContactsLoader(getActivity(), listflags, cursorFilter, addCreateGroupLinks, false, allowCreation);
|
||||
return new DcContactsLoader(getActivity(), listflags, cursorFilter, addCreateGroupLinks, addCreateContactLink, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,16 +17,16 @@ public class DcContactsLoader extends AsyncLoader<DcContactsLoader.Ret> {
|
||||
private final int listflags;
|
||||
private final String query;
|
||||
private final boolean addCreateGroupLinks;
|
||||
private final boolean addCreateContactLink;
|
||||
private final boolean blockedContacts;
|
||||
private final boolean allowCreation;
|
||||
|
||||
public DcContactsLoader(Context context, int listflags, String query, boolean addCreateGroupLinks, boolean blockedContacts, boolean allowCreation) {
|
||||
public DcContactsLoader(Context context, int listflags, String query, boolean addCreateGroupLinks, boolean addCreateContactLink, boolean blockedContacts) {
|
||||
super(context);
|
||||
this.listflags = listflags;
|
||||
this.query = (query==null||query.isEmpty())? null : query;
|
||||
this.addCreateGroupLinks = addCreateGroupLinks;
|
||||
this.addCreateContactLink= addCreateContactLink;
|
||||
this.blockedContacts = blockedContacts;
|
||||
this.allowCreation = allowCreation;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -41,7 +41,7 @@ public class DcContactsLoader extends AsyncLoader<DcContactsLoader.Ret> {
|
||||
int[] contact_ids = dcContext.getContacts(listflags, query);
|
||||
if(query!=null) {
|
||||
// show the "new contact" link also for partly typed e-mail addresses, so that the user knows he can continue
|
||||
if (allowCreation && dcContext.lookupContactIdByAddr(query)==0 && (listflags&DcContext.DC_GCL_VERIFIED_ONLY)==0) {
|
||||
if (addCreateContactLink && dcContext.lookupContactIdByAddr(query)==0 && (listflags&DcContext.DC_GCL_VERIFIED_ONLY)==0) {
|
||||
contact_ids = Util.appendInt(contact_ids, DcContact.DC_CONTACT_ID_NEW_CONTACT);
|
||||
}
|
||||
return new DcContactsLoader.Ret(contact_ids, query);
|
||||
|
||||
Reference in New Issue
Block a user