mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Version 3.7: Fix a crash in some langpacks.
This commit is contained in:
parent
000d9d8b52
commit
e3dc4ae088
2 changed files with 5 additions and 2 deletions
|
@ -43,6 +43,7 @@ constexpr auto kVisibleButtonsCount = 7;
|
||||||
|
|
||||||
PeerId GenerateUser(not_null<History*> history, const QString &name) {
|
PeerId GenerateUser(not_null<History*> history, const QString &name) {
|
||||||
Expects(history->peer->isUser());
|
Expects(history->peer->isUser());
|
||||||
|
|
||||||
const auto peerId = Data::FakePeerIdForJustName(name);
|
const auto peerId = Data::FakePeerIdForJustName(name);
|
||||||
history->owner().processUser(MTP_user(
|
history->owner().processUser(MTP_user(
|
||||||
MTP_flags(MTPDuser::Flag::f_first_name | MTPDuser::Flag::f_min),
|
MTP_flags(MTPDuser::Flag::f_first_name | MTPDuser::Flag::f_min),
|
||||||
|
|
|
@ -81,9 +81,11 @@ style::color PeerUserpicColor(PeerId peerId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
PeerId FakePeerIdForJustName(const QString &name) {
|
PeerId FakePeerIdForJustName(const QString &name) {
|
||||||
return peerFromUser(name.isEmpty()
|
constexpr auto kShift = (0xFEULL << 32);
|
||||||
|
const auto base = name.isEmpty()
|
||||||
? 777
|
? 777
|
||||||
: base::crc32(name.constData(), name.size() * sizeof(QChar)));
|
: base::crc32(name.constData(), name.size() * sizeof(QChar));
|
||||||
|
return peerFromUser(kShift + std::abs(base));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UpdateBotCommands(
|
bool UpdateBotCommands(
|
||||||
|
|
Loading…
Add table
Reference in a new issue