mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-04 11:00:46 +00:00
Use 48 bit [User/Chat/Channel]Id, 56 bit PeerId.
This commit is contained in:
@@ -37,7 +37,7 @@ Key ExtractKey(const QString &query) {
|
||||
const auto params = parse();
|
||||
const auto channel = params.value("channel");
|
||||
const auto post = params.value("post").toInt();
|
||||
return (channel.toInt() && post) ? Key{ channel, post } : Key();
|
||||
return (channel.toULongLong() && post) ? Key{ channel, post } : Key();
|
||||
} else if (check.startsWith(qstr("tg://resolve"), Qt::CaseInsensitive)) {
|
||||
const auto params = parse();
|
||||
const auto domain = params.value("domain");
|
||||
@@ -112,7 +112,7 @@ std::optional<HistoryItem*> SingleMessageSearch::performLookupByChannel(
|
||||
&& received.messageIds.front() == postId) {
|
||||
_cache.emplace(
|
||||
_requestKey,
|
||||
FullMsgId(channel->bareId(), postId));
|
||||
FullMsgId(peerToChannel(channel->id), postId));
|
||||
ready();
|
||||
} else {
|
||||
fail();
|
||||
@@ -142,7 +142,7 @@ std::optional<HistoryItem*> SingleMessageSearch::performLookupById(
|
||||
_requestId = _session->api().request(MTPchannels_GetChannels(
|
||||
MTP_vector<MTPInputChannel>(
|
||||
1,
|
||||
MTP_inputChannel(MTP_int(channelId), MTP_long(0)))
|
||||
MTP_inputChannel(MTP_int(channelId.bare), MTP_long(0))) // #TODO ids
|
||||
)).done([=](const MTPmessages_Chats &result) {
|
||||
result.match([&](const auto &data) {
|
||||
const auto peer = _session->data().processChats(data.vchats());
|
||||
@@ -212,7 +212,7 @@ std::optional<HistoryItem*> SingleMessageSearch::performLookup(
|
||||
if (!_requestKey.domainOrId[0].isDigit()) {
|
||||
return performLookupByUsername(_requestKey.domainOrId, ready);
|
||||
}
|
||||
const auto channelId = _requestKey.domainOrId.toInt();
|
||||
const auto channelId = ChannelId(_requestKey.domainOrId.toULongLong());
|
||||
return performLookupById(channelId, ready);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user