mirror of https://github.com/M66B/FairEmail.git
Support for adding keywords
This commit is contained in:
parent
76178a81df
commit
1d62bc5978
|
@ -1232,6 +1232,38 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
|
|||
}.load(context, owner, args);
|
||||
}
|
||||
})
|
||||
.setNeutralButton(R.string.title_add, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
final EditText etKeyword = new EditText(context);
|
||||
new DialogBuilderLifecycle(context, owner)
|
||||
.setTitle(R.string.title_add)
|
||||
.setView(etKeyword)
|
||||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
String keyword = Helper.sanitizeKeyword(etKeyword.getText().toString());
|
||||
if (!TextUtils.isEmpty(keyword)) {
|
||||
args.putString("keyword", keyword);
|
||||
|
||||
new SimpleTask<Void>() {
|
||||
@Override
|
||||
protected Void onLoad(Context context, Bundle args) throws Throwable {
|
||||
EntityMessage message = (EntityMessage) args.getSerializable("message");
|
||||
String keyword = args.getString("keyword");
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
EntityOperation.queue(db, message, EntityOperation.KEYWORD, keyword, true);
|
||||
EntityOperation.process(context);
|
||||
|
||||
return null;
|
||||
}
|
||||
}.load(context, owner, args);
|
||||
}
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
})
|
||||
.show();
|
||||
}
|
||||
}.load(context, owner, args);
|
||||
|
|
|
@ -1500,7 +1500,7 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
}
|
||||
|
||||
// https://tools.ietf.org/html/rfc3501#section-2.3.2
|
||||
String keyword = Helper.sanitizeKeyword(jargs.getString(0));
|
||||
String keyword = jargs.getString(0);
|
||||
boolean set = jargs.getBoolean(1);
|
||||
|
||||
Message imessage = ifolder.getMessageByUID(message.uid);
|
||||
|
|
|
@ -333,6 +333,7 @@
|
|||
<string name="title_yes">Yes</string>
|
||||
<string name="title_no">No</string>
|
||||
<string name="title_undo">Undo</string>
|
||||
<string name="title_add">Add</string>
|
||||
|
||||
<string name="title_try">Try FairEmail, an open source, privacy friendly email app for Android</string>
|
||||
|
||||
|
|
Loading…
Reference in New Issue