mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-17 07:30:16 -05:00
find src/com/fsck/ -name \*.java|xargs astyle --style=ansi
--mode=java --indent-switches --indent=spaces=4 --convert-tabs --unpad=paren
This commit is contained in:
parent
96b93f7327
commit
a826f33eb3
@ -240,9 +240,9 @@ public class Account implements BaseAccount
|
|||||||
goToUnreadMessageSearch = preferences.getPreferences().getBoolean(mUuid + ".goToUnreadMessageSearch",
|
goToUnreadMessageSearch = preferences.getPreferences().getBoolean(mUuid + ".goToUnreadMessageSearch",
|
||||||
false);
|
false);
|
||||||
subscribedFoldersOnly = preferences.getPreferences().getBoolean(mUuid + ".subscribedFoldersOnly",
|
subscribedFoldersOnly = preferences.getPreferences().getBoolean(mUuid + ".subscribedFoldersOnly",
|
||||||
false);
|
false);
|
||||||
maximumPolledMessageAge = preferences.getPreferences().getInt(mUuid
|
maximumPolledMessageAge = preferences.getPreferences().getInt(mUuid
|
||||||
+ ".maximumPolledMessageAge", -1);
|
+ ".maximumPolledMessageAge", -1);
|
||||||
mQuotePrefix = preferences.getPreferences().getString(mUuid + ".quotePrefix", DEFAULT_QUOTE_PREFIX);
|
mQuotePrefix = preferences.getPreferences().getString(mUuid + ".quotePrefix", DEFAULT_QUOTE_PREFIX);
|
||||||
for (String type : networkTypes)
|
for (String type : networkTypes)
|
||||||
{
|
{
|
||||||
@ -549,13 +549,13 @@ public class Account implements BaseAccount
|
|||||||
|
|
||||||
// Always get stats about the INBOX (see issue 1817)
|
// Always get stats about the INBOX (see issue 1817)
|
||||||
if (folder.getName().equals(K9.INBOX) || (
|
if (folder.getName().equals(K9.INBOX) || (
|
||||||
folder.getName().equals(getTrashFolderName()) == false &&
|
folder.getName().equals(getTrashFolderName()) == false &&
|
||||||
folder.getName().equals(getDraftsFolderName()) == false &&
|
folder.getName().equals(getDraftsFolderName()) == false &&
|
||||||
folder.getName().equals(getArchiveFolderName()) == false &&
|
folder.getName().equals(getArchiveFolderName()) == false &&
|
||||||
folder.getName().equals(getSpamFolderName()) == false &&
|
folder.getName().equals(getSpamFolderName()) == false &&
|
||||||
folder.getName().equals(getOutboxFolderName()) == false &&
|
folder.getName().equals(getOutboxFolderName()) == false &&
|
||||||
folder.getName().equals(getSentFolderName()) == false &&
|
folder.getName().equals(getSentFolderName()) == false &&
|
||||||
folder.getName().equals(getErrorFolderName()) == false))
|
folder.getName().equals(getErrorFolderName()) == false))
|
||||||
{
|
{
|
||||||
if (aMode == Account.FolderMode.NONE)
|
if (aMode == Account.FolderMode.NONE)
|
||||||
{
|
{
|
||||||
@ -1346,23 +1346,23 @@ public class Account implements BaseAccount
|
|||||||
now.add(Calendar.DATE, age * -1);
|
now.add(Calendar.DATE, age * -1);
|
||||||
}
|
}
|
||||||
else switch (age)
|
else switch (age)
|
||||||
{
|
{
|
||||||
case 28:
|
case 28:
|
||||||
now.add(Calendar.MONTH, -1);
|
now.add(Calendar.MONTH, -1);
|
||||||
break;
|
break;
|
||||||
case 56:
|
case 56:
|
||||||
now.add(Calendar.MONTH, -2);
|
now.add(Calendar.MONTH, -2);
|
||||||
break;
|
break;
|
||||||
case 84:
|
case 84:
|
||||||
now.add(Calendar.MONTH, -3);
|
now.add(Calendar.MONTH, -3);
|
||||||
break;
|
break;
|
||||||
case 168:
|
case 168:
|
||||||
now.add(Calendar.MONTH, -6);
|
now.add(Calendar.MONTH, -6);
|
||||||
break;
|
break;
|
||||||
case 365:
|
case 365:
|
||||||
now.add(Calendar.YEAR, -1);
|
now.add(Calendar.YEAR, -1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return now.getTime();
|
return now.getTime();
|
||||||
}
|
}
|
||||||
|
@ -62,12 +62,12 @@ public class Identity implements Serializable
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized String getReplyTo()
|
public synchronized String getReplyTo()
|
||||||
{
|
{
|
||||||
return replyTo;
|
return replyTo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void setReplyTo(String replyTo)
|
public synchronized void setReplyTo(String replyTo)
|
||||||
{
|
{
|
||||||
this.replyTo = replyTo;
|
this.replyTo = replyTo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ public class ChooseFolder extends K9ListActivity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (name.equals(mFolder) ||
|
else if (name.equals(mFolder) ||
|
||||||
(K9.INBOX.equalsIgnoreCase(mFolder) && K9.INBOX.equalsIgnoreCase(name)))
|
(K9.INBOX.equalsIgnoreCase(mFolder) && K9.INBOX.equalsIgnoreCase(name)))
|
||||||
{
|
{
|
||||||
selectedFolder = position;
|
selectedFolder = position;
|
||||||
}
|
}
|
||||||
|
@ -1256,25 +1256,25 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
{
|
{
|
||||||
case DIALOG_SAVE_OR_DISCARD_DRAFT_MESSAGE:
|
case DIALOG_SAVE_OR_DISCARD_DRAFT_MESSAGE:
|
||||||
return new AlertDialog.Builder(this)
|
return new AlertDialog.Builder(this)
|
||||||
.setTitle(R.string.save_or_discard_draft_message_dlg_title)
|
.setTitle(R.string.save_or_discard_draft_message_dlg_title)
|
||||||
.setMessage(R.string.save_or_discard_draft_message_instructions_fmt)
|
.setMessage(R.string.save_or_discard_draft_message_instructions_fmt)
|
||||||
.setPositiveButton(R.string.save_draft_action, new DialogInterface.OnClickListener()
|
.setPositiveButton(R.string.save_draft_action, new DialogInterface.OnClickListener()
|
||||||
|
{
|
||||||
|
public void onClick(DialogInterface dialog, int whichButton)
|
||||||
{
|
{
|
||||||
public void onClick(DialogInterface dialog, int whichButton)
|
dismissDialog(1);
|
||||||
{
|
onSave();
|
||||||
dismissDialog(1);
|
}
|
||||||
onSave();
|
})
|
||||||
}
|
.setNegativeButton(R.string.discard_action, new DialogInterface.OnClickListener()
|
||||||
})
|
{
|
||||||
.setNegativeButton(R.string.discard_action, new DialogInterface.OnClickListener()
|
public void onClick(DialogInterface dialog, int whichButton)
|
||||||
{
|
{
|
||||||
public void onClick(DialogInterface dialog, int whichButton)
|
dismissDialog(1);
|
||||||
{
|
onDiscard();
|
||||||
dismissDialog(1);
|
}
|
||||||
onDiscard();
|
})
|
||||||
}
|
.create();
|
||||||
})
|
|
||||||
.create();
|
|
||||||
}
|
}
|
||||||
return super.onCreateDialog(id);
|
return super.onCreateDialog(id);
|
||||||
}
|
}
|
||||||
@ -1416,7 +1416,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
|
|||||||
// the replaceAll() invocation.
|
// the replaceAll() invocation.
|
||||||
final String escapedPrefix = prefix.replaceAll("(\\\\|\\$)", "\\\\$1");
|
final String escapedPrefix = prefix.replaceAll("(\\\\|\\$)", "\\\\$1");
|
||||||
quotedText += MimeUtility.getTextFromPart(part).replaceAll(
|
quotedText += MimeUtility.getTextFromPart(part).replaceAll(
|
||||||
"(?m)^", escapedPrefix);
|
"(?m)^", escapedPrefix);
|
||||||
|
|
||||||
quotedText = quotedText.replaceAll("\\\r", "");
|
quotedText = quotedText.replaceAll("\\\r", "");
|
||||||
mQuotedText.setText(quotedText);
|
mQuotedText.setText(quotedText);
|
||||||
|
@ -1505,7 +1505,7 @@ public class MessageList
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.same_sender:
|
case R.id.same_sender:
|
||||||
MessageList.actionHandle(MessageList.this,
|
MessageList.actionHandle(MessageList.this,
|
||||||
"From "+holder.sender, holder.sender, true,
|
"From "+holder.sender, holder.sender, true,
|
||||||
null, null);
|
null, null);
|
||||||
|
|
||||||
|
@ -1035,7 +1035,7 @@ public class MessageView extends K9Activity implements OnClickListener
|
|||||||
}
|
}
|
||||||
showNextMessage();
|
showNextMessage();
|
||||||
MessagingController.getInstance(getApplication())
|
MessagingController.getInstance(getApplication())
|
||||||
.moveMessage(mAccount, srcFolder, messageToMove, dstFolder, null);
|
.moveMessage(mAccount, srcFolder, messageToMove, dstFolder, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onSpam()
|
private void onSpam()
|
||||||
@ -1060,7 +1060,7 @@ public class MessageView extends K9Activity implements OnClickListener
|
|||||||
}
|
}
|
||||||
showNextMessage();
|
showNextMessage();
|
||||||
MessagingController.getInstance(getApplication())
|
MessagingController.getInstance(getApplication())
|
||||||
.moveMessage(mAccount, srcFolder, messageToMove, dstFolder, null);
|
.moveMessage(mAccount, srcFolder, messageToMove, dstFolder, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showNextMessage()
|
private void showNextMessage()
|
||||||
|
@ -1131,7 +1131,7 @@ public class MessagingController implements Runnable
|
|||||||
|
|
||||||
if (visibleLimit < 1)
|
if (visibleLimit < 1)
|
||||||
{
|
{
|
||||||
visibleLimit = K9.DEFAULT_VISIBLE_LIMIT;
|
visibleLimit = K9.DEFAULT_VISIBLE_LIMIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
Message[] remoteMessageArray = new Message[0];
|
Message[] remoteMessageArray = new Message[0];
|
||||||
@ -1501,12 +1501,12 @@ public class MessagingController implements Runnable
|
|||||||
if (message.isSet(Flag.DELETED))
|
if (message.isSet(Flag.DELETED))
|
||||||
{
|
{
|
||||||
Log.v(K9.LOG_TAG, "Newly downloaded message " + account + ":" + folder + ":" + message.getUid()
|
Log.v(K9.LOG_TAG, "Newly downloaded message " + account + ":" + folder + ":" + message.getUid()
|
||||||
+ " was already deleted on server, skipping");
|
+ " was already deleted on server, skipping");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Log.d(K9.LOG_TAG, "Newly downloaded message " + message.getUid() + " is older than "
|
Log.d(K9.LOG_TAG, "Newly downloaded message " + message.getUid() + " is older than "
|
||||||
+ earliestDate + ", skipping");
|
+ earliestDate + ", skipping");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
progress.incrementAndGet();
|
progress.incrementAndGet();
|
||||||
@ -1625,7 +1625,7 @@ public class MessagingController implements Runnable
|
|||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
{
|
{
|
||||||
Log.d(K9.LOG_TAG, "Message " + message.getUid() + " is older than "
|
Log.d(K9.LOG_TAG, "Message " + message.getUid() + " is older than "
|
||||||
+ earliestDate + ", hence not saving");
|
+ earliestDate + ", hence not saving");
|
||||||
}
|
}
|
||||||
progress.incrementAndGet();
|
progress.incrementAndGet();
|
||||||
|
|
||||||
@ -1702,7 +1702,7 @@ public class MessagingController implements Runnable
|
|||||||
if (K9.DEBUG)
|
if (K9.DEBUG)
|
||||||
{
|
{
|
||||||
Log.d(K9.LOG_TAG, "Message " + message.getUid() + " is older than "
|
Log.d(K9.LOG_TAG, "Message " + message.getUid() + " is older than "
|
||||||
+ earliestDate + ", hence not saving");
|
+ earliestDate + ", hence not saving");
|
||||||
}
|
}
|
||||||
progress.incrementAndGet();
|
progress.incrementAndGet();
|
||||||
|
|
||||||
@ -4548,8 +4548,8 @@ public class MessagingController implements Runnable
|
|||||||
String folderName = folder.getName();
|
String folderName = folder.getName();
|
||||||
if (!K9.INBOX.equals(folderName) &&
|
if (!K9.INBOX.equals(folderName) &&
|
||||||
(account.getTrashFolderName().equals(folderName)
|
(account.getTrashFolderName().equals(folderName)
|
||||||
|| account.getDraftsFolderName().equals(folderName)
|
|| account.getDraftsFolderName().equals(folderName)
|
||||||
|| account.getSentFolderName().equals(folderName)))
|
|| account.getSentFolderName().equals(folderName)))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -4636,28 +4636,40 @@ public class MessagingController implements Runnable
|
|||||||
if (account.isVibrate())
|
if (account.isVibrate())
|
||||||
{
|
{
|
||||||
int times = account.getVibrateTimes();
|
int times = account.getVibrateTimes();
|
||||||
long[] pattern1 = new long[]{100,200};
|
long[] pattern1 = new long[] {100,200};
|
||||||
long[] pattern2 = new long[]{100,500};
|
long[] pattern2 = new long[] {100,500};
|
||||||
long[] pattern3 = new long[]{200,200};
|
long[] pattern3 = new long[] {200,200};
|
||||||
long[] pattern4 = new long[]{200,500};
|
long[] pattern4 = new long[] {200,500};
|
||||||
long[] pattern5 = new long[]{500,500};
|
long[] pattern5 = new long[] {500,500};
|
||||||
long[] src = null;
|
long[] src = null;
|
||||||
|
|
||||||
switch (account.getVibratePattern())
|
switch (account.getVibratePattern())
|
||||||
{
|
{
|
||||||
case 1: src = pattern1; break;
|
case 1:
|
||||||
case 2: src = pattern2; break;
|
src = pattern1;
|
||||||
case 3: src = pattern3; break;
|
break;
|
||||||
case 4: src = pattern4; break;
|
case 2:
|
||||||
case 5: src = pattern5; break;
|
src = pattern2;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
src = pattern3;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
src = pattern4;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
src = pattern5;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
notif.defaults |= Notification.DEFAULT_VIBRATE;
|
notif.defaults |= Notification.DEFAULT_VIBRATE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (src != null) {
|
if (src != null)
|
||||||
|
{
|
||||||
long[] dest = new long[src.length * times];
|
long[] dest = new long[src.length * times];
|
||||||
for (int n = 0; n < times; n++) {
|
for (int n = 0; n < times; n++)
|
||||||
|
{
|
||||||
System.arraycopy(src, 0, dest, n * src.length, src.length);
|
System.arraycopy(src, 0, dest, n * src.length, src.length);
|
||||||
}
|
}
|
||||||
notif.vibrate = dest;
|
notif.vibrate = dest;
|
||||||
|
@ -302,64 +302,64 @@ public class ImapStore extends Store
|
|||||||
|
|
||||||
private List<? extends Folder> listFolders(ImapConnection connection, boolean LSUB) throws IOException, MessagingException
|
private List<? extends Folder> listFolders(ImapConnection connection, boolean LSUB) throws IOException, MessagingException
|
||||||
{
|
{
|
||||||
String commandResponse = LSUB ? "LSUB" : "LIST";
|
String commandResponse = LSUB ? "LSUB" : "LIST";
|
||||||
|
|
||||||
LinkedList<Folder> folders = new LinkedList<Folder>();
|
LinkedList<Folder> folders = new LinkedList<Folder>();
|
||||||
|
|
||||||
List<ImapResponse> responses =
|
List<ImapResponse> responses =
|
||||||
connection.executeSimpleCommand(String.format(commandResponse + " \"\" \"%s*\"",
|
connection.executeSimpleCommand(String.format(commandResponse + " \"\" \"%s*\"",
|
||||||
getCombinedPrefix()));
|
getCombinedPrefix()));
|
||||||
|
|
||||||
for (ImapResponse response : responses)
|
for (ImapResponse response : responses)
|
||||||
|
{
|
||||||
|
if (ImapResponseParser.equalsIgnoreCase(response.get(0), commandResponse))
|
||||||
{
|
{
|
||||||
if (ImapResponseParser.equalsIgnoreCase(response.get(0), commandResponse))
|
boolean includeFolder = true;
|
||||||
|
String folder = decodeFolderName(response.getString(3));
|
||||||
|
|
||||||
|
if (mPathDelimeter == null)
|
||||||
{
|
{
|
||||||
boolean includeFolder = true;
|
mPathDelimeter = response.getString(2);
|
||||||
String folder = decodeFolderName(response.getString(3));
|
mCombinedPrefix = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (mPathDelimeter == null)
|
if (folder.equalsIgnoreCase(K9.INBOX))
|
||||||
{
|
{
|
||||||
mPathDelimeter = response.getString(2);
|
continue;
|
||||||
mCombinedPrefix = null;
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
|
||||||
if (folder.equalsIgnoreCase(K9.INBOX))
|
if (getCombinedPrefix().length() > 0)
|
||||||
{
|
{
|
||||||
continue;
|
if (folder.length() >= getCombinedPrefix().length())
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
if (getCombinedPrefix().length() > 0)
|
|
||||||
{
|
{
|
||||||
if (folder.length() >= getCombinedPrefix().length())
|
folder = folder.substring(getCombinedPrefix().length());
|
||||||
{
|
|
||||||
folder = folder.substring(getCombinedPrefix().length());
|
|
||||||
}
|
|
||||||
if (!decodeFolderName(response.getString(3)).equalsIgnoreCase(getCombinedPrefix() + folder))
|
|
||||||
{
|
|
||||||
includeFolder = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
if (!decodeFolderName(response.getString(3)).equalsIgnoreCase(getCombinedPrefix() + folder))
|
||||||
|
|
||||||
ImapList attributes = response.getList(1);
|
|
||||||
for (int i = 0, count = attributes.size(); i < count; i++)
|
|
||||||
{
|
|
||||||
String attribute = attributes.getString(i);
|
|
||||||
if (attribute.equalsIgnoreCase("\\NoSelect"))
|
|
||||||
{
|
{
|
||||||
includeFolder = false;
|
includeFolder = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (includeFolder)
|
}
|
||||||
|
|
||||||
|
ImapList attributes = response.getList(1);
|
||||||
|
for (int i = 0, count = attributes.size(); i < count; i++)
|
||||||
|
{
|
||||||
|
String attribute = attributes.getString(i);
|
||||||
|
if (attribute.equalsIgnoreCase("\\NoSelect"))
|
||||||
{
|
{
|
||||||
folders.add(getFolder(folder));
|
includeFolder = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (includeFolder)
|
||||||
|
{
|
||||||
|
folders.add(getFolder(folder));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
folders.add(getFolder("INBOX"));
|
}
|
||||||
return folders;
|
folders.add(getFolder("INBOX"));
|
||||||
|
return folders;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1022,7 +1022,7 @@ public class ImapStore extends Store
|
|||||||
if (earliestDate != null)
|
if (earliestDate != null)
|
||||||
{
|
{
|
||||||
dateSearchString.append(" SINCE ");
|
dateSearchString.append(" SINCE ");
|
||||||
synchronized(RFC3501_DATE)
|
synchronized (RFC3501_DATE)
|
||||||
{
|
{
|
||||||
dateSearchString.append(RFC3501_DATE.format(earliestDate));
|
dateSearchString.append(RFC3501_DATE.format(earliestDate));
|
||||||
}
|
}
|
||||||
@ -2988,11 +2988,11 @@ public class ImapStore extends Store
|
|||||||
idling.set(true);
|
idling.set(true);
|
||||||
doneSent.set(false);
|
doneSent.set(false);
|
||||||
|
|
||||||
if (conn == null)
|
if (conn == null)
|
||||||
{
|
{
|
||||||
throw new MessagingException("No connection available for idling");
|
throw new MessagingException("No connection available for idling");
|
||||||
}
|
}
|
||||||
conn.setReadTimeout((getAccount().getIdleRefreshMinutes() * 60 * 1000) + IDLE_READ_TIMEOUT_INCREMENT);
|
conn.setReadTimeout((getAccount().getIdleRefreshMinutes() * 60 * 1000) + IDLE_READ_TIMEOUT_INCREMENT);
|
||||||
untaggedResponses = executeSimpleCommand(COMMAND_IDLE, false, ImapFolderPusher.this);
|
untaggedResponses = executeSimpleCommand(COMMAND_IDLE, false, ImapFolderPusher.this);
|
||||||
idling.set(false);
|
idling.set(false);
|
||||||
delayTime.set(NORMAL_DELAY_TIME);
|
delayTime.set(NORMAL_DELAY_TIME);
|
||||||
|
@ -434,7 +434,7 @@ public class SmtpTransport extends Transport
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
commandToLog = "SMTP >>> " + s;
|
commandToLog = "SMTP >>> " + s;
|
||||||
}
|
}
|
||||||
Log.d(K9.LOG_TAG, commandToLog);
|
Log.d(K9.LOG_TAG, commandToLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,7 +474,7 @@ public class SmtpTransport extends Transport
|
|||||||
|
|
||||||
private List<String> executeSimpleCommand(String command) throws IOException, MessagingException
|
private List<String> executeSimpleCommand(String command) throws IOException, MessagingException
|
||||||
{
|
{
|
||||||
return executeSimpleCommand(command, false);
|
return executeSimpleCommand(command, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> executeSimpleCommand(String command, boolean sensitive)
|
private List<String> executeSimpleCommand(String command, boolean sensitive)
|
||||||
|
Loading…
Reference in New Issue
Block a user