use of com.fsck.k9.search.LocalSearch in project k-9 by k9mail.
the class LocalStore method getMessagesInThread.
public List<LocalMessage> getMessagesInThread(final long rootId) throws MessagingException {
String rootIdString = Long.toString(rootId);
LocalSearch search = new LocalSearch();
search.and(SearchField.THREAD_ID, rootIdString, Attribute.EQUALS);
return searchForMessages(null, search);
}
use of com.fsck.k9.search.LocalSearch in project k-9 by k9mail.
the class NotificationActionCreator method buildUnreadBackStack.
private TaskStackBuilder buildUnreadBackStack(final Account account) {
TaskStackBuilder stack = buildAccountsBackStack();
LocalSearch search = Accounts.createUnreadSearch(context, account);
Intent intent = MessageList.intentDisplaySearch(context, search, true, false, false);
stack.addNextIntent(intent);
return stack;
}
use of com.fsck.k9.search.LocalSearch in project k-9 by k9mail.
the class NotificationActionCreator method buildMessageListBackStack.
private TaskStackBuilder buildMessageListBackStack(Account account, String folderName) {
TaskStackBuilder stack = skipFolderListInBackStack(account, folderName) ? buildAccountsBackStack() : buildFolderListBackStack(account);
LocalSearch search = new LocalSearch(folderName);
search.addAllowedFolder(folderName);
search.addAccountUuid(account.getUuid());
Intent intent = MessageList.intentDisplaySearch(context, search, false, true, true);
stack.addNextIntent(intent);
return stack;
}
use of com.fsck.k9.search.LocalSearch in project k-9 by k9mail.
the class MessageCompose method openAutoExpandFolder.
private void openAutoExpandFolder() {
String folder = account.getAutoExpandFolderName();
LocalSearch search = new LocalSearch(folder);
search.addAccountUuid(account.getUuid());
search.addAllowedFolder(folder);
MessageList.actionDisplaySearch(this, search, false, true);
finish();
}
use of com.fsck.k9.search.LocalSearch in project k-9 by k9mail.
the class Accounts method onOpenAccount.
/**
* Show that account's inbox or folder-list
* or return false if the account is not available.
* @param account the account to open ({@link SearchAccount} or {@link Account})
* @return false if unsuccessful
*/
private boolean onOpenAccount(BaseAccount account) {
if (account instanceof SearchAccount) {
SearchAccount searchAccount = (SearchAccount) account;
MessageList.actionDisplaySearch(this, searchAccount.getRelatedSearch(), false, false);
} else {
Account realAccount = (Account) account;
if (!realAccount.isEnabled()) {
onActivateAccount(realAccount);
return false;
} else if (!realAccount.isAvailable(this)) {
String toastText = getString(R.string.account_unavailable, account.getDescription());
Toast toast = Toast.makeText(getApplication(), toastText, Toast.LENGTH_SHORT);
toast.show();
Timber.i("refusing to open account that is not available");
return false;
}
if (K9.FOLDER_NONE.equals(realAccount.getAutoExpandFolderName())) {
FolderList.actionHandleAccount(this, realAccount);
} else {
LocalSearch search = new LocalSearch(realAccount.getAutoExpandFolderName());
search.addAllowedFolder(realAccount.getAutoExpandFolderName());
search.addAccountUuid(realAccount.getUuid());
MessageList.actionDisplaySearch(this, search, false, true);
}
}
return true;
}
Aggregations