2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 23:45:44 +00:00

beta version 9015005

This commit is contained in:
John Preston
2016-01-01 05:00:28 +08:00
parent d876861431
commit 87becf552b
6 changed files with 44 additions and 43 deletions

View File

@@ -1880,11 +1880,15 @@ void StickerPanInner::refreshInlineRows(UserData *bot, const InlineResults &resu
int32 count = results.size(), until = 0, untilrow = 0, untilcol = 0;
if (!count) {
clearInlineRows(resultsDeleted);
_showingSavedGifs = true;
if (_showingInlineItems) {
refreshSavedGifs();
emit scrollToY(0);
emit scrollUpdated();
_showingSavedGifs = cShowingSavedGifs();
if (_showingSavedGifs) {
refreshSavedGifs();
emit scrollToY(0);
emit scrollUpdated();
} else {
showStickerSet(RecentStickerSetId);
}
}
return;
}
@@ -2353,6 +2357,7 @@ void StickerPanInner::showStickerSet(uint64 setId) {
bool wasNotShowingGifs = !_showingInlineItems;
if (wasNotShowingGifs) {
_showingInlineItems = true;
_showingSavedGifs = true;
cSetShowingSavedGifs(true);
emit saveConfigDelayed(SaveRecentEmojisTimeout);
}
@@ -2394,6 +2399,17 @@ void StickerPanInner::showStickerSet(uint64 setId) {
update();
}
void StickerPanInner::updateShowingSavedGifs() {
if (cShowingSavedGifs()) {
if (!_showingInlineItems) {
_showingSavedGifs = _showingInlineItems = true;
if (_inlineRows.isEmpty()) refreshSavedGifs();
}
} else if (!_showingInlineItems) {
_showingSavedGifs = _showingInlineItems = false;
}
}
void StickerPanInner::showFinish() {
if (_showingInlineItems && _showingSavedGifs) {
_setGifCommand = App::insertBotCommand((cTestMode() ? qstr("@contextbot") : qstr("@gif")), true);
@@ -3437,6 +3453,8 @@ void EmojiPan::onSwitch() {
s_inner.showStickerSet(DefaultStickerSetId);
} else if (!cShowingSavedGifs() && !cSavedGifs().isEmpty() && cStickerSets().isEmpty()) {
s_inner.showStickerSet(NoneStickerSetId);
} else {
s_inner.updateShowingSavedGifs();
}
if (cShowingSavedGifs()) {
s_inner.showFinish();