2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 07:35:12 +00:00

Use server-side my_results in contacts.search.

This commit is contained in:
John Preston
2018-01-22 13:58:11 +03:00
parent 4527c03c0d
commit 840b42934b
13 changed files with 224 additions and 93 deletions

View File

@@ -18,6 +18,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Ui {
namespace {
constexpr auto kMaxUsernameLength = 32;
template <typename InputClass>
class InputStyle : public QCommonStyle {
public:
@@ -3976,7 +3978,9 @@ void UsernameInput::correctValue(
if (newPos > 0) --newPos;
}
len -= from;
if (len > MaxUsernameLength) len = MaxUsernameLength + (now.at(from) == '@' ? 1 : 0);
if (len > kMaxUsernameLength) {
len = kMaxUsernameLength + (now.at(from) == '@' ? 1 : 0);
}
for (int32 to = from + len; to > from;) {
--to;
if (!now.at(to).isSpace()) {