Fixed build for macOS.

This commit is contained in:
23rd 2021-09-30 17:40:51 +03:00 committed by John Preston
parent 64af456d29
commit 21f7cec781
3 changed files with 18 additions and 4 deletions

View File

@ -60,7 +60,7 @@ void ViewsManager::viewsIncrement() {
QVector<MTPint> ids;
ids.reserve(i->second.size());
for (const auto msgId : i->second) {
for (const auto &msgId : i->second) {
ids.push_back(MTP_int(msgId));
}
const auto requestId = _api.request(MTPmessages_GetMessagesViews(

View File

@ -1761,7 +1761,7 @@ void ApiWrap::deleteAllFromUser(
? history->collectMessagesFromUserToDelete(from)
: QVector<MsgId>();
const auto channelId = peerToChannel(channel->id);
for (const auto msgId : ids) {
for (const auto &msgId : ids) {
if (const auto item = _session->data().message(channelId, msgId)) {
item->destroy();
}

View File

@ -256,11 +256,25 @@ void Manager::Private::showNotification(
NSUserNotification *notification = [[[NSUserNotification alloc] init] autorelease];
if ([notification respondsToSelector:@selector(setIdentifier:)]) {
auto identifier = _managerIdString + '_' + QString::number(peer->id.value) + '_' + QString::number(msgId);
auto identifier = _managerIdString
+ '_'
+ QString::number(peer->id.value)
+ '_'
+ QString::number(msgId.bare);
auto identifierValue = Q2NSString(identifier);
[notification setIdentifier:identifierValue];
}
[notification setUserInfo:[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedLongLong:peer->session().uniqueId()],@"session",[NSNumber numberWithUnsignedLongLong:peer->id.value],@"peer",[NSNumber numberWithInt:msgId],@"msgid",[NSNumber numberWithUnsignedLongLong:_managerId],@"manager",nil]];
[notification setUserInfo:
[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithUnsignedLongLong:peer->session().uniqueId()],
@"session",
[NSNumber numberWithUnsignedLongLong:peer->id.value],
@"peer",
[NSNumber numberWithInt:msgId.bare],
@"msgid",
[NSNumber numberWithUnsignedLongLong:_managerId],
@"manager",
nil]];
[notification setTitle:Q2NSString(title)];
[notification setSubtitle:Q2NSString(subtitle)];