2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

fixed media_only dcs, added copy post link to clipboard, fixed signature display in gifs, 0.9.27 dev version

This commit is contained in:
John Preston
2016-02-25 20:23:42 +03:00
parent 2b6e30bcb5
commit 37309a91ac
14 changed files with 71 additions and 96 deletions

View File

@@ -3769,16 +3769,17 @@ void MainWidget::incrementSticker(DocumentData *sticker) {
RecentStickerPack::iterator i = recent.begin(), e = recent.end();
for (; i != e; ++i) {
if (i->first == sticker) {
++i->second;
if (i->second > 0x8000) {
for (RecentStickerPack::iterator j = recent.begin(); j != e; ++j) {
if (j->second > 1) {
j->second /= 2;
} else {
j->second = 1;
}
}
}
i->second = recent.begin()->second; // throw to the first place
//++i->second;
//if (i->second > 0x8000) {
// for (RecentStickerPack::iterator j = recent.begin(); j != e; ++j) {
// if (j->second > 1) {
// j->second /= 2;
// } else {
// j->second = 1;
// }
// }
//}
for (; i != recent.begin(); --i) {
if ((i - 1)->second > i->second) {
break;
@@ -3790,13 +3791,14 @@ void MainWidget::incrementSticker(DocumentData *sticker) {
}
if (i == e) {
while (recent.size() >= StickerPanPerRow * StickerPanRowsPerPage) recent.pop_back();
recent.push_back(qMakePair(sticker, 1));
for (i = recent.end() - 1; i != recent.begin(); --i) {
if ((i - 1)->second > i->second) {
break;
}
qSwap(*i, *(i - 1));
}
recent.push_front(qMakePair(sticker, recent.isEmpty() ? 1 : recent.begin()->second));
//recent.push_back(qMakePair(sticker, 1));
//for (i = recent.end() - 1; i != recent.begin(); --i) {
// if ((i - 1)->second > i->second) {
// break;
// }
// qSwap(*i, *(i - 1));
//}
}
Local::writeUserSettings();