mirror of https://github.com/procxx/kepka.git
Add 'Share my phone number' click handler.
This commit is contained in:
parent
08d4715ad6
commit
3a34b15841
|
@ -296,6 +296,15 @@ void ContactStatus::setupBlockHandler(not_null<UserData*> peer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContactStatus::setupShareHandler(not_null<UserData*> peer) {
|
void ContactStatus::setupShareHandler(not_null<UserData*> peer) {
|
||||||
|
_bar.entity()->shareClicks(
|
||||||
|
) | rpl::start_with_next([=] {
|
||||||
|
peer->setSettings(0);
|
||||||
|
peer->session().api().request(MTPcontacts_AcceptContact(
|
||||||
|
peer->inputUser
|
||||||
|
)).done([=](const MTPUpdates &result) {
|
||||||
|
peer->session().api().applyUpdates(result);
|
||||||
|
}).send();
|
||||||
|
}, _bar.lifetime());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContactStatus::setupReportHandler(not_null<PeerData*> peer) {
|
void ContactStatus::setupReportHandler(not_null<PeerData*> peer) {
|
||||||
|
|
|
@ -4218,7 +4218,11 @@ void MainWidget::feedUpdate(const MTPUpdate &update) {
|
||||||
const auto &d = update.c_updatePeerSettings();
|
const auto &d = update.c_updatePeerSettings();
|
||||||
const auto peerId = peerFromMTP(d.vpeer);
|
const auto peerId = peerFromMTP(d.vpeer);
|
||||||
if (const auto peer = session().data().peerLoaded(peerId)) {
|
if (const auto peer = session().data().peerLoaded(peerId)) {
|
||||||
//peer->updateSettings(d.vsettings);
|
const auto settings = d.vsettings.match([](
|
||||||
|
const MTPDpeerSettings &data) {
|
||||||
|
return data.vflags.v;
|
||||||
|
});
|
||||||
|
peer->setSettings(settings);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue