Fix reading one message if last one is outgoing.
This commit is contained in:
parent
662966ba31
commit
f2f19b14eb
|
@ -1631,7 +1631,16 @@ void History::setUnreadCount(int newUnreadCount) {
|
||||||
const auto notifier = unreadStateChangeNotifier(true);
|
const auto notifier = unreadStateChangeNotifier(true);
|
||||||
_unreadCount = newUnreadCount;
|
_unreadCount = newUnreadCount;
|
||||||
|
|
||||||
if (newUnreadCount == 1) {
|
const auto lastOutgoing = [&] {
|
||||||
|
const auto last = lastMessage();
|
||||||
|
return last
|
||||||
|
&& IsServerMsgId(last->id)
|
||||||
|
&& loadedAtBottom()
|
||||||
|
&& !isEmpty()
|
||||||
|
&& blocks.back()->messages.back()->data() == last
|
||||||
|
&& last->out();
|
||||||
|
}();
|
||||||
|
if (newUnreadCount == 1 && !lastOutgoing) {
|
||||||
if (loadedAtBottom()) {
|
if (loadedAtBottom()) {
|
||||||
_firstUnreadView = !isEmpty()
|
_firstUnreadView = !isEmpty()
|
||||||
? blocks.back()->messages.back().get()
|
? blocks.back()->messages.back().get()
|
||||||
|
|
Loading…
Reference in New Issue