mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
half warnings fixed, half disabled for mac build, custom openssl build used, fixed notify activate, bold fonts etc
This commit is contained in:
@@ -156,6 +156,13 @@ namespace App {
|
||||
return (peer_id & 0x100000000L) ? MTP_peerChat(MTP_int(int32(peer_id & 0xFFFFFFFFL))) : MTP_peerUser(MTP_int(int32(peer_id & 0xFFFFFFFFL)));
|
||||
}
|
||||
|
||||
int32 userFromPeer(const PeerId &peer_id) {
|
||||
return (peer_id & 0x100000000L) ? 0 : int32(peer_id & 0xFFFFFFFFL);
|
||||
}
|
||||
int32 chatFromPeer(const PeerId &peer_id) {
|
||||
return (peer_id & 0x100000000L) ? int32(peer_id & 0xFFFFFFFFL) : 0;
|
||||
}
|
||||
|
||||
int32 onlineWillChangeIn(int32 online, int32 now) {
|
||||
if (online <= 0) return 86400;
|
||||
if (online > now) {
|
||||
@@ -314,7 +321,7 @@ namespace App {
|
||||
case mtpc_userStatusOnline: data->onlineTill = status->c_userStatusOnline().vexpires.v; break;
|
||||
}
|
||||
|
||||
if (data->contact < 0 && !data->phone.isEmpty() && data->id != MTP::authedId()) {
|
||||
if (data->contact < 0 && !data->phone.isEmpty() && (data->id & 0xFFFFFFFF) != MTP::authedId()) {
|
||||
data->contact = 0;
|
||||
}
|
||||
if (data->contact > 0 && !wasContact) {
|
||||
@@ -605,7 +612,7 @@ namespace App {
|
||||
}
|
||||
if (user->contact > 0) {
|
||||
if (!wasContact) {
|
||||
App::main()->addNewContact(user->id & 0xFFFFFFFF, false);
|
||||
App::main()->addNewContact(App::userFromPeer(user->id), false);
|
||||
user->input = MTP_inputPeerContact(userId);
|
||||
user->inputUser = MTP_inputUserContact(userId);
|
||||
}
|
||||
@@ -614,7 +621,7 @@ namespace App {
|
||||
user->input = MTP_inputPeerForeign(userId, MTP_long(user->access));
|
||||
user->inputUser = MTP_inputUserForeign(userId, MTP_long(user->access));
|
||||
}
|
||||
if (user->contact < 0 && !user->phone.isEmpty() && user->id != MTP::authedId()) {
|
||||
if (user->contact < 0 && !user->phone.isEmpty() && App::userFromPeer(user->id) != MTP::authedId()) {
|
||||
user->contact = 0;
|
||||
}
|
||||
if (wasContact) {
|
||||
@@ -1608,7 +1615,7 @@ namespace App {
|
||||
continue;
|
||||
}
|
||||
uint32 dataLen = *(const uint32*)decrypted.constData();
|
||||
if (dataLen > decrypted.size() || dataLen <= fullDataLen - 16 || dataLen < 4) {
|
||||
if (dataLen > uint32(decrypted.size()) || dataLen <= fullDataLen - 16 || dataLen < 4) {
|
||||
LOG(("App Error: bad decrypted part size: %1, fullDataLen: %2, decrypted size: %3").arg(dataLen).arg(fullDataLen).arg(decrypted.size()));
|
||||
continue;
|
||||
}
|
||||
@@ -1774,7 +1781,7 @@ namespace App {
|
||||
quint32 count;
|
||||
stream >> count;
|
||||
|
||||
for (int32 i = 0; i < count; ++i) {
|
||||
for (uint32 i = 0; i < count; ++i) {
|
||||
readOneMuted(stream);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user