2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-05 09:05:14 +00:00

Updated TDesktop sources to 2.4.7

This commit is contained in:
RadRussianRus
2020-11-09 05:04:24 +03:00
390 changed files with 13355 additions and 7386 deletions

View File

@@ -15,7 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_window.h"
#include "storage/localstorage.h"
#include "ui/empty_userpic.h"
#include "ui/text_options.h"
#include "ui/text/text_options.h"
#include "ui/unread_badge.h"
#include "lang/lang_keys.h"
#include "support/support_helper.h"
@@ -39,10 +39,16 @@ namespace {
constexpr int kRecentlyInSeconds = 20 * 3600;
const auto kPsaBadgePrefix = "cloud_lng_badge_psa_";
bool ShowUserBotIcon(not_null<UserData*> user) {
[[nodiscard]] bool ShowUserBotIcon(not_null<UserData*> user) {
return user->isBot() && !user->isSupport() && !user->isRepliesChat();
}
[[nodiscard]] bool ShowSendActionInDialogs(History *history) {
return history
&& (!history->peer->isUser()
|| history->peer->asUser()->onlineTill > 0);
}
void PaintRowTopRight(Painter &p, const QString &text, QRect &rectForName, bool active, bool selected) {
const auto width = st::dialogsDateFont->width(text);
rectForName.setWidth(rectForName.width() - width - st::dialogsDateSkip);
@@ -536,7 +542,8 @@ void paintRow(
p.setFont(st::dialogsTextFont);
auto &color = active ? st::dialogsTextFgServiceActive : (selected ? st::dialogsTextFgServiceOver : st::dialogsTextFgService);
if (history && !history->sendActionPainter()->paint(p, nameleft, texttop, availableWidth, fullWidth, color, ms)) {
if (!ShowSendActionInDialogs(history)
|| !history->sendActionPainter()->paint(p, nameleft, texttop, availableWidth, fullWidth, color, ms)) {
if (history->cloudDraftTextCache.isEmpty()) {
auto draftWrapped = textcmdLink(1, tr::lng_dialogs_text_from_wrapped(tr::now, lt_from, tr::lng_from_draft(tr::now)));
auto draftText = supportMode
@@ -563,7 +570,8 @@ void paintRow(
auto &color = active ? st::dialogsTextFgServiceActive : (selected ? st::dialogsTextFgServiceOver : st::dialogsTextFgService);
p.setFont(st::dialogsTextFont);
if (history && !history->sendActionPainter()->paint(p, nameleft, texttop, availableWidth, fullWidth, color, ms)) {
if (!ShowSendActionInDialogs(history)
|| !history->sendActionPainter()->paint(p, nameleft, texttop, availableWidth, fullWidth, color, ms)) {
// Empty history
}
} else if (!item->isEmpty()) {
@@ -929,14 +937,16 @@ void RowPainter::paint(
texttop,
availableWidth,
st::dialogsTextFont->height);
const auto actionWasPainted = history ? history->sendActionPainter()->paint(
p,
itemRect.x(),
itemRect.y(),
itemRect.width(),
fullWidth,
color,
ms) : false;
const auto actionWasPainted = ShowSendActionInDialogs(history)
? history->sendActionPainter()->paint(
p,
itemRect.x(),
itemRect.y(),
itemRect.width(),
fullWidth,
color,
ms)
: false;
if (const auto folder = row->folder()) {
PaintListEntryText(p, itemRect, active, selected, row);
} else if (!actionWasPainted) {