Fixed auto expand after searching

pull/198/head
M66B 4 years ago
parent 5120cd7444
commit 0773ceca23

@ -4999,7 +4999,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
int count = 0; int count = 0;
int unseen = 0; int unseen = 0;
int flagged = 0; int flagged = 0;
int found = 0; int finds = 0;
TupleMessageEx singleMessage = null; TupleMessageEx singleMessage = null;
TupleMessageEx unseenMessage = null; TupleMessageEx unseenMessage = null;
TupleMessageEx flaggedMessage = null; TupleMessageEx flaggedMessage = null;
@ -5032,8 +5032,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
(message.id.equals(id) || Objects.equals(message.msgid, msgid))) (message.id.equals(id) || Objects.equals(message.msgid, msgid)))
pinnedMessage = message; pinnedMessage = message;
if (!message.duplicate && message.ui_found) { if (found && !message.duplicate && message.ui_found) {
found++; finds++;
if (foundMessage == null) if (foundMessage == null)
foundMessage = message; foundMessage = message;
} }
@ -5049,8 +5049,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
// - sole message // - sole message
if (autoexpand) { if (autoexpand) {
TupleMessageEx expand = null; TupleMessageEx expand = null;
if (found > 0) { if (finds > 0) {
if (found == 1) if (finds == 1)
expand = foundMessage; expand = foundMessage;
} else if (pinnedMessage != null) } else if (pinnedMessage != null)
expand = pinnedMessage; expand = pinnedMessage;

Loading…
Cancel
Save