mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Don't request settings of unknown peers.
This commit is contained in:
parent
af8c1f77c7
commit
405230c0c6
1 changed files with 23 additions and 0 deletions
|
@ -1727,6 +1727,29 @@ void ApiWrap::leaveChannel(not_null<ChannelData*> channel) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ApiWrap::requestNotifySettings(const MTPInputNotifyPeer &peer) {
|
void ApiWrap::requestNotifySettings(const MTPInputNotifyPeer &peer) {
|
||||||
|
const auto bad = peer.match([](const MTPDinputNotifyUsers &) {
|
||||||
|
return false;
|
||||||
|
}, [](const MTPDinputNotifyChats &) {
|
||||||
|
return false;
|
||||||
|
}, [](const MTPDinputNotifyBroadcasts &) {
|
||||||
|
return false;
|
||||||
|
}, [&](const MTPDinputNotifyPeer &data) {
|
||||||
|
if (data.vpeer().type() == mtpc_inputPeerEmpty) {
|
||||||
|
LOG(("Api Error: Requesting settings for empty peer."));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}, [&](const MTPDinputNotifyForumTopic &data) {
|
||||||
|
if (data.vpeer().type() == mtpc_inputPeerEmpty) {
|
||||||
|
LOG(("Api Error: Requesting settings for empty peer topic."));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
if (bad) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const auto peerFromInput = [&](const MTPInputPeer &inputPeer) {
|
const auto peerFromInput = [&](const MTPInputPeer &inputPeer) {
|
||||||
return inputPeer.match([&](const MTPDinputPeerSelf &) {
|
return inputPeer.match([&](const MTPDinputPeerSelf &) {
|
||||||
return _session->userPeerId();
|
return _session->userPeerId();
|
||||||
|
|
Loading…
Add table
Reference in a new issue