mirror of https://github.com/M66B/FairEmail.git
Allow Gmail raw searches
This commit is contained in:
parent
82dd4465c6
commit
8fba0ac5c8
|
@ -199,6 +199,12 @@ public class ViewModelBrowse extends ViewModel {
|
||||||
try {
|
try {
|
||||||
// https://tools.ietf.org/html/rfc3501#section-6.4.4
|
// https://tools.ietf.org/html/rfc3501#section-6.4.4
|
||||||
Argument arg = new Argument();
|
Argument arg = new Argument();
|
||||||
|
if (state.search.startsWith("raw:") && state.istore.hasCapability("X-GM-EXT-1")) {
|
||||||
|
// https://support.google.com/mail/answer/7190
|
||||||
|
// https://developers.google.com/gmail/imap/imap-extensions#extension_of_the_search_command_x-gm-raw
|
||||||
|
arg.writeAtom("X-GM-RAW");
|
||||||
|
arg.writeString(state.search.substring(4));
|
||||||
|
} else {
|
||||||
if (!protocol.supportsUtf8()) {
|
if (!protocol.supportsUtf8()) {
|
||||||
arg.writeAtom("CHARSET");
|
arg.writeAtom("CHARSET");
|
||||||
arg.writeAtom("UTF-8");
|
arg.writeAtom("UTF-8");
|
||||||
|
@ -220,6 +226,7 @@ public class ViewModelBrowse extends ViewModel {
|
||||||
arg.writeAtom("KEYWORD");
|
arg.writeAtom("KEYWORD");
|
||||||
arg.writeBytes(state.search.getBytes());
|
arg.writeBytes(state.search.getBytes());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Log.i("Boundary UTF8 search=" + state.search);
|
Log.i("Boundary UTF8 search=" + state.search);
|
||||||
Response[] responses = protocol.command("SEARCH", arg);
|
Response[] responses = protocol.command("SEARCH", arg);
|
||||||
|
|
Loading…
Reference in New Issue