Browse Source

Several fixes

main
M66B 6 years ago
parent
commit
63e40513fb
4 changed files with 16 additions and 7 deletions
  1. +6
    -2
      app/src/main/java/eu/faircode/email/FragmentIdentity.java
  2. +4
    -4
      app/src/main/java/eu/faircode/email/FragmentMessages.java
  3. +5
    -0
      app/src/main/java/eu/faircode/email/ServiceSynchronize.java
  4. +1
    -1
      app/src/main/res/values/strings.xml

+ 6
- 2
app/src/main/java/eu/faircode/email/FragmentIdentity.java View File

@ -160,7 +160,7 @@ public class FragmentIdentity extends Fragment {
args.putBoolean("starttls", cbStartTls.isChecked());
args.putString("port", etPort.getText().toString());
args.putString("user", etUser.getText().toString());
args.putString("password", tilPassword.getEditText().toString());
args.putString("password", tilPassword.getEditText().getText().toString());
args.putBoolean("primary", cbPrimary.isChecked());
args.putBoolean("synchronize", cbSynchronize.isChecked());
@ -208,9 +208,13 @@ public class FragmentIdentity extends Fragment {
public Throwable loadInBackground() {
try {
long id = args.getLong("id");
String replyto = args.getString("replyto");
String host = args.getString("host");
boolean starttls = args.getBoolean("starttls");
String port = args.getString("port");
if (TextUtils.isEmpty(replyto))
replyto = null;
if (TextUtils.isEmpty(port))
port = "0";
@ -221,7 +225,7 @@ public class FragmentIdentity extends Fragment {
identity = new EntityIdentity();
identity.name = Objects.requireNonNull(args.getString("name"));
identity.email = Objects.requireNonNull(args.getString("email"));
identity.replyto = args.getString("replyto");
identity.replyto = replyto;
identity.host = host;
identity.port = Integer.parseInt(port);
identity.starttls = starttls;


+ 4
- 4
app/src/main/java/eu/faircode/email/FragmentMessages.java View File

@ -92,7 +92,7 @@ public class FragmentMessages extends Fragment {
tvNoEmail.setVisibility(View.GONE);
grpReady.setVisibility(View.GONE);
pbWait.setVisibility(View.VISIBLE);
fab.setEnabled(false);
fab.setVisibility(View.GONE);
DB db = DB.getInstance(getContext());
@ -109,8 +109,6 @@ public class FragmentMessages extends Fragment {
db.message().liveThread(thread).observe(this, messagesObserver);
}
getLoaderManager().restartLoader(ActivityView.LOADER_MESSAGES_INIT, new Bundle(), initLoaderCallbacks).forceLoad();
return view;
}
@ -121,6 +119,8 @@ public class FragmentMessages extends Fragment {
((AppCompatActivity) getActivity()).getSupportActionBar().setSubtitle(R.string.title_folder_thread);
else
liveFolder.observe(this, folderObserver);
getLoaderManager().restartLoader(ActivityView.LOADER_MESSAGES_INIT, new Bundle(), initLoaderCallbacks).forceLoad();
}
@Override
@ -181,7 +181,7 @@ public class FragmentMessages extends Fragment {
@Override
public void onLoadFinished(@NonNull Loader<Bundle> loader, Bundle data) {
fab.setEnabled(data.getBoolean("drafts", false));
fab.setVisibility(data.getBoolean("drafts", false) ? View.VISIBLE : View.GONE);
}
@Override


+ 5
- 0
app/src/main/java/eu/faircode/email/ServiceSynchronize.java View File

@ -639,6 +639,11 @@ public class ServiceSynchronize extends LifecycleService {
EntityMessage reply = (msg.replying == null ? null : message.getMessage(msg.replying));
EntityIdentity ident = db.identity().getIdentity(msg.identity);
if (!ident.synchronize) {
// Message will remain in outbox
return;
}
Properties props = MessageHelper.getSessionProperties();
Session isession = Session.getDefaultInstance(props, null);


+ 1
- 1
app/src/main/res/values/strings.xml View File

@ -54,7 +54,7 @@
<string name="title_password">Password</string>
<string name="title_synchronize_account">Synchronize (receive messages)</string>
<string name="title_synchronize_identity">Synchronize (send messages)</string>
<string name="title_primary_account">Primary (use to store drafts)</string>
<string name="title_primary_account">Primary (used to store drafts)</string>
<string name="title_primary_identity">Primary (default identity)</string>
<string name="title_no_name">Name mandatory</string>
<string name="title_no_email">Email address mandatory</string>


Loading…
Cancel
Save