Search sender

This commit is contained in:
M66B 2022-11-28 16:31:04 +01:00
parent 770d83c803
commit 8e59ee9b5e
4 changed files with 16 additions and 10 deletions

View File

@ -168,7 +168,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
static final String ACTION_VIEW_FOLDERS = BuildConfig.APPLICATION_ID + ".VIEW_FOLDERS";
static final String ACTION_VIEW_MESSAGES = BuildConfig.APPLICATION_ID + ".VIEW_MESSAGES";
static final String ACTION_SEARCH_ADDRESS = BuildConfig.APPLICATION_ID + ".SEARCH_ADDRESS";
static final String ACTION_SEARCH_SENDER = BuildConfig.APPLICATION_ID + ".SEARCH_SENDER";
static final String ACTION_VIEW_THREAD = BuildConfig.APPLICATION_ID + ".VIEW_THREAD";
static final String ACTION_EDIT_FOLDER = BuildConfig.APPLICATION_ID + ".EDIT_FOLDER";
static final String ACTION_VIEW_OUTBOX = BuildConfig.APPLICATION_ID + ".VIEW_OUTBOX";
@ -1072,7 +1072,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
IntentFilter iff = new IntentFilter();
iff.addAction(ACTION_VIEW_FOLDERS);
iff.addAction(ACTION_VIEW_MESSAGES);
iff.addAction(ACTION_SEARCH_ADDRESS);
iff.addAction(ACTION_SEARCH_SENDER);
iff.addAction(ACTION_VIEW_THREAD);
iff.addAction(ACTION_EDIT_FOLDER);
iff.addAction(ACTION_VIEW_OUTBOX);
@ -2116,8 +2116,8 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
onViewFolders(intent);
else if (ACTION_VIEW_MESSAGES.equals(action))
onViewMessages(intent);
else if (ACTION_SEARCH_ADDRESS.equals(action))
onSearchAddress(intent);
else if (ACTION_SEARCH_SENDER.equals(action))
onSearchSender(intent);
else if (ACTION_VIEW_THREAD.equals(action))
onViewThread(intent);
else if (ACTION_EDIT_FOLDER.equals(action))
@ -2175,7 +2175,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
fragmentTransaction.commit();
}
private void onSearchAddress(Intent intent) {
private void onSearchSender(Intent intent) {
long account = intent.getLongExtra("account", -1);
long folder = intent.getLongExtra("folder", -1);
String query = intent.getStringExtra("query");
@ -2186,6 +2186,12 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
BoundaryCallbackMessages.SearchCriteria criteria = new BoundaryCallbackMessages.SearchCriteria();
criteria.query = query;
criteria.fts = fts;
criteria.in_senders = true;
criteria.in_recipients = false;
criteria.in_subject = false;
criteria.in_keywords = false;
criteria.in_message = false;
criteria.in_notes = false;
FragmentMessages.search(
this, this, getSupportFragmentManager(),

View File

@ -272,7 +272,7 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(
new Intent(ActivityView.ACTION_SEARCH_ADDRESS)
new Intent(ActivityView.ACTION_SEARCH_SENDER)
.putExtra("account", -1L)
.putExtra("folder", -1L)
.putExtra("query", MailTo.parse(uri).getTo()));
@ -525,9 +525,9 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
tvTitle.setText(title);
tvTitle.setVisibility(TextUtils.isEmpty(title) ? View.GONE : View.VISIBLE);
ibSearch.setVisibility(
ibSearch.setVisibility(context instanceof ActivityView &&
mailto != null && !TextUtils.isEmpty(mailto.getTo())
? View.VISIBLE : View.GONE);
? View.VISIBLE : View.GONE);
if (host != null && !host.equals(puny)) {
etLink.setText(format(uri.buildUpon().encodedAuthority(puny).build(), context));

View File

@ -10161,7 +10161,7 @@ public class FragmentMessages extends FragmentBase
String query = ((InternetAddress) addresses[0]).getAddress();
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(context);
lbm.sendBroadcast(
new Intent(ActivityView.ACTION_SEARCH_ADDRESS)
new Intent(ActivityView.ACTION_SEARCH_SENDER)
.putExtra("account", -1L)
.putExtra("folder", -1L)
.putExtra("query", query));

View File

@ -207,7 +207,7 @@
android:layout_marginTop="12dp"
android:drawableEnd="@drawable/twotone_search_24"
android:drawablePadding="6dp"
android:text="@string/title_button_search"
android:text="@string/title_search_sender"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"