mirror of https://github.com/procxx/kepka.git
Fixed checkboxes in boxes. Clearing cloud draft on inline result send.
No history to down if unread appear in an inactive opened conversation.
This commit is contained in:
parent
fccae52654
commit
be2a0abbc8
|
@ -250,9 +250,9 @@ defaultCheckbox: Checkbox {
|
||||||
font: normalFont;
|
font: normalFont;
|
||||||
duration: 120;
|
duration: 120;
|
||||||
}
|
}
|
||||||
defaultBoxCheckbox: Checkbox {
|
defaultBoxCheckbox: Checkbox(defaultCheckbox) {
|
||||||
width: -46px;
|
width: -46px;
|
||||||
textPosition: point(34px, 0px);
|
textPosition: point(34px, 1px);
|
||||||
font: boxTextFont;
|
font: boxTextFont;
|
||||||
}
|
}
|
||||||
defaultRadiobutton: Radiobutton {
|
defaultRadiobutton: Radiobutton {
|
||||||
|
|
|
@ -1149,7 +1149,6 @@ void History::newItemAdded(HistoryItem *item) {
|
||||||
if (!item->unread()) {
|
if (!item->unread()) {
|
||||||
outboxRead(item);
|
outboxRead(item);
|
||||||
}
|
}
|
||||||
item->history()->clearCloudDraft();
|
|
||||||
} else if (item->unread()) {
|
} else if (item->unread()) {
|
||||||
bool skip = false;
|
bool skip = false;
|
||||||
if (!isChannel() || peer->asChannel()->amIn()) {
|
if (!isChannel() || peer->asChannel()->amIn()) {
|
||||||
|
|
|
@ -7017,7 +7017,16 @@ void HistoryWidget::updateBotKeyboard(History *h, bool force) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::updateToEndVisibility() {
|
void HistoryWidget::updateToEndVisibility() {
|
||||||
auto isToEndVisible = [this]() {
|
auto haveUnreadBelowBottom = [this](History *history) {
|
||||||
|
if (!_list || !history || history->unreadCount() <= 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!history->showFrom || history->showFrom->detached()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return (_list->itemTop(history->showFrom) >= _scroll.scrollTop() + _scroll.height());
|
||||||
|
};
|
||||||
|
auto isToEndVisible = [this, &haveUnreadBelowBottom]() {
|
||||||
if (!_history || _a_show.animating() || _firstLoadRequest) {
|
if (!_history || _a_show.animating() || _firstLoadRequest) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -7027,7 +7036,7 @@ void HistoryWidget::updateToEndVisibility() {
|
||||||
if (_scroll.scrollTop() + st::wndMinHeight < _scroll.scrollTopMax()) {
|
if (_scroll.scrollTop() + st::wndMinHeight < _scroll.scrollTopMax()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (_history->unreadCount() > 0 || (_migrated && _migrated->unreadCount() > 0)) {
|
if (haveUnreadBelowBottom(_history) || haveUnreadBelowBottom(_migrated)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -7159,9 +7168,10 @@ void HistoryWidget::onInlineResultSend(InlineBots::Result *result, UserData *bot
|
||||||
App::historyRegRandom(randomId, newId);
|
App::historyRegRandom(randomId, newId);
|
||||||
|
|
||||||
clearFieldText();
|
clearFieldText();
|
||||||
_saveDraftText = true;
|
//_saveDraftText = true;
|
||||||
_saveDraftStart = getms();
|
//_saveDraftStart = getms();
|
||||||
onDraftSave();
|
//onDraftSave();
|
||||||
|
onCloudDraftSave(); // won't be needed if SendInlineBotResult will clear the cloud draft
|
||||||
|
|
||||||
RecentInlineBots &bots(cRefRecentInlineBots());
|
RecentInlineBots &bots(cRefRecentInlineBots());
|
||||||
int32 index = bots.indexOf(bot);
|
int32 index = bots.indexOf(bot);
|
||||||
|
@ -7332,9 +7342,10 @@ void HistoryWidget::sendExistingDocument(DocumentData *doc, const QString &capti
|
||||||
|
|
||||||
if (_fieldAutocomplete->stickersShown()) {
|
if (_fieldAutocomplete->stickersShown()) {
|
||||||
clearFieldText();
|
clearFieldText();
|
||||||
_saveDraftText = true;
|
//_saveDraftText = true;
|
||||||
_saveDraftStart = getms();
|
//_saveDraftStart = getms();
|
||||||
onDraftSave();
|
//onDraftSave();
|
||||||
|
onCloudDraftSave(); // won't be needed if SendInlineBotResult will clear the cloud draft
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_fieldAutocomplete->isHidden()) _fieldAutocomplete->hideStart();
|
if (!_fieldAutocomplete->isHidden()) _fieldAutocomplete->hideStart();
|
||||||
|
|
Loading…
Reference in New Issue