mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-30 23:38:25 +00:00
Use new box for editing contact name.
This commit is contained in:
parent
2162aa8df0
commit
9066acd2dd
@ -34,6 +34,9 @@ public:
|
||||
void setWidth(int width) {
|
||||
_width = width;
|
||||
}
|
||||
void setFocusCallback(Fn<void()> callback) {
|
||||
_focus = callback;
|
||||
}
|
||||
|
||||
int rowsCount() const {
|
||||
return _content->count();
|
||||
@ -65,6 +68,12 @@ public:
|
||||
|
||||
void addSkip(int height);
|
||||
|
||||
void setInnerFocus() override {
|
||||
if (_focus) {
|
||||
_focus();
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
void prepare() override;
|
||||
|
||||
@ -90,6 +99,7 @@ private:
|
||||
-> Initer<std::decay_t<InitMethod>, std::decay_t<InitArgs>...>;
|
||||
|
||||
FnMut<void(not_null<GenericBox*>)> _init;
|
||||
Fn<void()> _focus;
|
||||
object_ptr<Ui::VerticalLayout> _content;
|
||||
int _width = 0;
|
||||
|
||||
|
@ -1,50 +0,0 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "boxes/abstract_box.h"
|
||||
|
||||
class UserData;
|
||||
|
||||
namespace Window {
|
||||
class Controller;
|
||||
} // namespace Window
|
||||
|
||||
namespace Ui {
|
||||
class VerticalLayout;
|
||||
} // namespace Ui
|
||||
|
||||
class AddToContactsBox : public BoxContent {
|
||||
public:
|
||||
AddToContactsBox(
|
||||
QWidget*,
|
||||
not_null<Window::Controller*> window,
|
||||
not_null<UserData*> user);
|
||||
|
||||
protected:
|
||||
void prepare() override;
|
||||
|
||||
void setInnerFocus() override;
|
||||
|
||||
private:
|
||||
void setupContent();
|
||||
void setupCover(not_null<Ui::VerticalLayout*> container);
|
||||
void setupNameFields(not_null<Ui::VerticalLayout*> container);
|
||||
void setupWarning(not_null<Ui::VerticalLayout*> container);
|
||||
void initNameFields(
|
||||
not_null<Ui::InputField*> first,
|
||||
not_null<Ui::InputField*> last,
|
||||
bool inverted);
|
||||
|
||||
not_null<Window::Controller*> _window;
|
||||
not_null<UserData*> _user;
|
||||
QString _phone;
|
||||
Fn<void()> _focus;
|
||||
Fn<void()> _save;
|
||||
|
||||
};
|
@ -5,8 +5,9 @@ the official desktop application for the Telegram messaging service.
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "boxes/peers/add_to_contacts_box.h"
|
||||
#include "boxes/peers/edit_contact_box.h"
|
||||
|
||||
#include "boxes/generic_box.h"
|
||||
#include "data/data_user.h"
|
||||
#include "data/data_session.h"
|
||||
#include "ui/wrap/vertical_layout.h"
|
||||
@ -31,83 +32,162 @@ QString UserPhone(not_null<UserData*> user) {
|
||||
: phone;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
class Builder {
|
||||
public:
|
||||
Builder(
|
||||
not_null<GenericBox*> box,
|
||||
not_null<Window::Controller*> window,
|
||||
not_null<UserData*> user);
|
||||
|
||||
AddToContactsBox::AddToContactsBox(
|
||||
QWidget*,
|
||||
void build();
|
||||
|
||||
private:
|
||||
void setupContent();
|
||||
void setupCover();
|
||||
void setupNameFields();
|
||||
void setupWarning();
|
||||
void initNameFields(
|
||||
not_null<Ui::InputField*> first,
|
||||
not_null<Ui::InputField*> last,
|
||||
bool inverted);
|
||||
|
||||
not_null<GenericBox*> _box;
|
||||
not_null<Window::Controller*> _window;
|
||||
not_null<UserData*> _user;
|
||||
QString _phone;
|
||||
Fn<void()> _focus;
|
||||
Fn<void()> _save;
|
||||
|
||||
};
|
||||
|
||||
Builder::Builder(
|
||||
not_null<GenericBox*> box,
|
||||
not_null<Window::Controller*> window,
|
||||
not_null<UserData*> user)
|
||||
: _window(window)
|
||||
: _box(box)
|
||||
, _window(window)
|
||||
, _user(user)
|
||||
, _phone(UserPhone(user)) {
|
||||
}
|
||||
|
||||
void AddToContactsBox::prepare() {
|
||||
void Builder::build() {
|
||||
const auto box = _box;
|
||||
|
||||
setupContent();
|
||||
|
||||
setTitle(langFactory(lng_enter_contact_data));
|
||||
box->setTitle(langFactory(_user->isContact()
|
||||
? lng_edit_contact_title
|
||||
: lng_enter_contact_data));
|
||||
|
||||
addButton(langFactory(lng_box_done), [=] { _save(); });
|
||||
addButton(langFactory(lng_cancel), [=] { closeBox(); });
|
||||
box->addButton(langFactory(lng_box_done), _save);
|
||||
box->addButton(langFactory(lng_cancel), [=] { box->closeBox(); });
|
||||
box->setFocusCallback(_focus);
|
||||
}
|
||||
|
||||
void AddToContactsBox::setInnerFocus() {
|
||||
_focus();
|
||||
void Builder::setupContent() {
|
||||
setupCover();
|
||||
setupNameFields();
|
||||
setupWarning();
|
||||
}
|
||||
|
||||
void AddToContactsBox::setupContent() {
|
||||
const auto content = Ui::CreateChild<Ui::VerticalLayout>(this);
|
||||
|
||||
setupCover(content);
|
||||
setupNameFields(content);
|
||||
setupWarning(content);
|
||||
|
||||
setDimensionsToContent(st::boxWidth, content);
|
||||
void Builder::setupCover() {
|
||||
_box->addRow(
|
||||
object_ptr<Info::Profile::Cover>(
|
||||
_box,
|
||||
_user,
|
||||
_window->sessionController(),
|
||||
(_phone.isEmpty()
|
||||
? Lang::Viewer(lng_contact_mobile_hidden)
|
||||
: rpl::single(App::formatPhone(_phone)))),
|
||||
style::margins())->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
}
|
||||
|
||||
void AddToContactsBox::setupCover(not_null<Ui::VerticalLayout*> container) {
|
||||
container->add(object_ptr<Info::Profile::Cover>(
|
||||
container,
|
||||
_user,
|
||||
_window->sessionController(),
|
||||
(_phone.isEmpty()
|
||||
? Lang::Viewer(lng_contact_mobile_hidden)
|
||||
: rpl::single(App::formatPhone(_phone))))
|
||||
)->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
}
|
||||
|
||||
void AddToContactsBox::setupNameFields(
|
||||
not_null<Ui::VerticalLayout*> container) {
|
||||
void Builder::setupNameFields() {
|
||||
const auto inverted = langFirstNameGoesSecond();
|
||||
const auto first = container->add(
|
||||
const auto first = _box->addRow(
|
||||
object_ptr<Ui::InputField>(
|
||||
container,
|
||||
_box,
|
||||
st::defaultInputField,
|
||||
langFactory(lng_signup_firstname),
|
||||
_user->firstName),
|
||||
st::addContactFieldMargin);
|
||||
auto preparedLast = object_ptr<Ui::InputField>(
|
||||
container,
|
||||
_box,
|
||||
st::defaultInputField,
|
||||
langFactory(lng_signup_lastname),
|
||||
_user->lastName);
|
||||
const auto last = inverted
|
||||
? container->insert(
|
||||
container->count() - 1,
|
||||
? _box->insertRow(
|
||||
_box->rowsCount() - 1,
|
||||
std::move(preparedLast),
|
||||
st::addContactFieldMargin)
|
||||
: container->add(std::move(preparedLast), st::addContactFieldMargin);
|
||||
: _box->addRow(std::move(preparedLast), st::addContactFieldMargin);
|
||||
|
||||
initNameFields(first, last, inverted);
|
||||
}
|
||||
|
||||
void AddToContactsBox::initNameFields(
|
||||
void Builder::initNameFields(
|
||||
not_null<Ui::InputField*> first,
|
||||
not_null<Ui::InputField*> last,
|
||||
bool inverted) {
|
||||
const auto box = _box;
|
||||
const auto phone = _phone;
|
||||
const auto user = _user;
|
||||
const auto getValue = [](not_null<Ui::InputField*> field) {
|
||||
return TextUtilities::SingleLine(field->getLastText()).trimmed();
|
||||
};
|
||||
|
||||
if (inverted) {
|
||||
setTabOrder(last, first);
|
||||
box->setTabOrder(last, first);
|
||||
}
|
||||
const auto focus = [=] {
|
||||
const auto firstValue = getValue(first);
|
||||
const auto lastValue = getValue(last);
|
||||
const auto empty = firstValue.isEmpty() && lastValue.isEmpty();
|
||||
const auto focusFirst = (inverted != empty);
|
||||
(focusFirst ? first : last)->setFocusFast();
|
||||
};
|
||||
const auto save = [=] {
|
||||
const auto firstValue = getValue(first);
|
||||
const auto lastValue = getValue(last);
|
||||
const auto empty = firstValue.isEmpty() && lastValue.isEmpty();
|
||||
if (empty) {
|
||||
focus();
|
||||
(inverted ? last : first)->showError();
|
||||
return;
|
||||
}
|
||||
const auto wasContact = user->isContact();
|
||||
const auto weak = make_weak(box);
|
||||
user->session().api().request(MTPcontacts_AddContact(
|
||||
MTP_flags(0),
|
||||
user->inputUser,
|
||||
MTP_string(firstValue),
|
||||
MTP_string(lastValue),
|
||||
MTP_string(phone)
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
user->setName(
|
||||
firstValue,
|
||||
lastValue,
|
||||
user->nameOrPhone,
|
||||
user->username);
|
||||
user->session().api().applyUpdates(result);
|
||||
if (const auto settings = user->settings()) {
|
||||
using Flag = MTPDpeerSettings::Flag;
|
||||
const auto flags = Flag::f_add_contact
|
||||
| Flag::f_block_contact
|
||||
| Flag::f_report_spam;
|
||||
user->setSettings(*settings & ~flags);
|
||||
}
|
||||
if (weak) {
|
||||
weak->closeBox();
|
||||
}
|
||||
if (!wasContact) {
|
||||
Ui::Toast::Show(
|
||||
lng_new_contact_add_done(lt_user, firstValue));
|
||||
}
|
||||
}).fail([=](const RPCError &error) {
|
||||
}).send();
|
||||
};
|
||||
const auto submit = [=] {
|
||||
const auto firstValue = first->getLastText().trimmed();
|
||||
const auto lastValue = last->getLastText().trimmed();
|
||||
@ -120,53 +200,17 @@ void AddToContactsBox::initNameFields(
|
||||
_save();
|
||||
}
|
||||
};
|
||||
connect(first, &Ui::InputField::submitted, [=] { submit(); });
|
||||
connect(last, &Ui::InputField::submitted, [=] { submit(); });
|
||||
QObject::connect(first, &Ui::InputField::submitted, [=] { submit(); });
|
||||
QObject::connect(last, &Ui::InputField::submitted, [=] { submit(); });
|
||||
|
||||
_focus = [=] {
|
||||
const auto firstValue = first->getLastText().trimmed();
|
||||
const auto lastValue = last->getLastText().trimmed();
|
||||
const auto empty = firstValue.isEmpty() && lastValue.isEmpty();
|
||||
const auto focusFirst = (inverted != empty);
|
||||
(focusFirst ? first : last)->setFocusFast();
|
||||
};
|
||||
_save = [=] {
|
||||
const auto firstValue = first->getLastText().trimmed();
|
||||
const auto lastValue = last->getLastText().trimmed();
|
||||
const auto empty = firstValue.isEmpty() && lastValue.isEmpty();
|
||||
if (empty) {
|
||||
_focus();
|
||||
(inverted ? last : first)->showError();
|
||||
return;
|
||||
}
|
||||
const auto user = _user;
|
||||
const auto box = make_weak(this);
|
||||
user->session().api().request(MTPcontacts_AddContact(
|
||||
MTP_flags(0),
|
||||
user->inputUser,
|
||||
MTP_string(firstValue),
|
||||
MTP_string(lastValue),
|
||||
MTP_string(_phone)
|
||||
)).done([=](const MTPUpdates &result) {
|
||||
user->session().api().applyUpdates(result);
|
||||
if (const auto settings = user->settings()) {
|
||||
using Flag = MTPDpeerSettings::Flag;
|
||||
const auto flags = Flag::f_add_contact
|
||||
| Flag::f_block_contact
|
||||
| Flag::f_report_spam;
|
||||
user->setSettings(*settings & ~flags);
|
||||
}
|
||||
if (box) {
|
||||
box->closeBox();
|
||||
}
|
||||
Ui::Toast::Show(lng_new_contact_add_done(lt_user, firstValue));
|
||||
}).fail([=](const RPCError &error) {
|
||||
}).send();
|
||||
};
|
||||
_focus = focus;
|
||||
_save = save;
|
||||
}
|
||||
|
||||
void AddToContactsBox::setupWarning(
|
||||
not_null<Ui::VerticalLayout*> container) {
|
||||
void Builder::setupWarning() {
|
||||
if (_user->isContact()) {
|
||||
return;
|
||||
}
|
||||
const auto name = _user->shortName();
|
||||
const auto nameWithEntities = TextWithEntities{ name };
|
||||
const auto text = _phone.isEmpty()
|
||||
@ -182,10 +226,19 @@ void AddToContactsBox::setupWarning(
|
||||
Ui::Text::Bold(lang(lng_box_done).toUpper()),
|
||||
lt_user,
|
||||
TextWithEntities{ name });
|
||||
container->add(
|
||||
_box->addRow(
|
||||
object_ptr<Ui::FlatLabel>(
|
||||
container,
|
||||
_box,
|
||||
rpl::single(text),
|
||||
st::changePhoneLabel),
|
||||
st::addContactWarningMargin);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void EditContactBox(
|
||||
not_null<GenericBox*> box,
|
||||
not_null<Window::Controller*> window,
|
||||
not_null<UserData*> user) {
|
||||
Builder(box, window, user).build();
|
||||
}
|
20
Telegram/SourceFiles/boxes/peers/edit_contact_box.h
Normal file
20
Telegram/SourceFiles/boxes/peers/edit_contact_box.h
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
class UserData;
|
||||
class GenericBox;
|
||||
|
||||
namespace Window {
|
||||
class Controller;
|
||||
} // namespace Window
|
||||
|
||||
void EditContactBox(
|
||||
not_null<GenericBox*> box,
|
||||
not_null<Window::Controller*> window,
|
||||
not_null<UserData*> user);
|
@ -22,7 +22,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "apiwrap.h"
|
||||
#include "auth_session.h"
|
||||
#include "boxes/confirm_box.h"
|
||||
#include "boxes/generic_box.h"
|
||||
#include "boxes/generic_box.h" // window->show(Box(InitMethod()))
|
||||
#include "boxes/peers/edit_contact_box.h"
|
||||
#include "styles/style_history.h"
|
||||
#include "styles/style_boxes.h"
|
||||
|
||||
@ -293,14 +294,14 @@ void ContactStatus::setupHandlers(not_null<PeerData*> peer) {
|
||||
void ContactStatus::setupAddHandler(not_null<UserData*> user) {
|
||||
_bar.entity()->addClicks(
|
||||
) | rpl::start_with_next([=] {
|
||||
Window::PeerMenuAddContact(user);
|
||||
_window->show(Box(EditContactBox, _window, user));
|
||||
}, _bar.lifetime());
|
||||
}
|
||||
|
||||
void ContactStatus::setupBlockHandler(not_null<UserData*> user) {
|
||||
_bar.entity()->blockClicks(
|
||||
) | rpl::start_with_next([=] {
|
||||
_window->show(Box(Window::PeerMenuBlockUserBox, user, _window));
|
||||
_window->show(Box(Window::PeerMenuBlockUserBox, _window, user));
|
||||
}, _bar.lifetime());
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "boxes/peer_list_controllers.h"
|
||||
#include "boxes/add_contact_box.h"
|
||||
#include "boxes/report_box.h"
|
||||
#include "boxes/generic_box.h"
|
||||
#include "boxes/generic_box.h" // window->show(Box(InitMethod()))
|
||||
#include "boxes/peers/edit_contact_box.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "info/info_controller.h"
|
||||
#include "info/info_memento.h"
|
||||
@ -34,7 +35,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "info/profile/info_profile_text.h"
|
||||
#include "support/support_helper.h"
|
||||
#include "window/window_session_controller.h"
|
||||
#include "window/window_controller.h"
|
||||
#include "window/window_controller.h" // Window::Controller::show.
|
||||
#include "window/window_peer_menu.h"
|
||||
#include "mainwidget.h"
|
||||
#include "mainwindow.h" // MainWindow::controller.
|
||||
@ -405,11 +406,12 @@ Ui::MultiSlideTracker DetailsFiller::fillUserButtons(
|
||||
} else {
|
||||
addSendMessageButton();
|
||||
|
||||
const auto window = &_controller->parentController()->window()->controller();
|
||||
AddMainButton(
|
||||
_wrap,
|
||||
Lang::Viewer(lng_info_add_as_contact),
|
||||
CanAddContactValue(user),
|
||||
[user] { Window::PeerMenuAddContact(user); },
|
||||
[=] { window->show(Box(EditContactBox, window, user)); },
|
||||
tracker);
|
||||
}
|
||||
return tracker;
|
||||
@ -483,11 +485,12 @@ void ActionsFiller::addShareContactAction(not_null<UserData*> user) {
|
||||
}
|
||||
|
||||
void ActionsFiller::addEditContactAction(not_null<UserData*> user) {
|
||||
const auto window = &_controller->parentController()->window()->controller();
|
||||
AddActionButton(
|
||||
_wrap,
|
||||
Lang::Viewer(lng_info_edit_contact),
|
||||
IsContactValue(user),
|
||||
[=] { Ui::show(Box<AddContactBox>(user)); });
|
||||
[=] { window->show(Box(EditContactBox, window, user)); });
|
||||
}
|
||||
|
||||
void ActionsFiller::addDeleteContactAction(
|
||||
@ -603,7 +606,7 @@ void ActionsFiller::addBlockAction(not_null<UserData*> user) {
|
||||
} else if (user->isBot()) {
|
||||
user->session().api().blockUser(user);
|
||||
} else {
|
||||
window->show(Box(Window::PeerMenuBlockUserBox, user, window));
|
||||
window->show(Box(Window::PeerMenuBlockUserBox, window, user));
|
||||
}
|
||||
};
|
||||
AddActionButton(
|
||||
|
@ -15,7 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "boxes/generic_box.h"
|
||||
#include "boxes/create_poll_box.h"
|
||||
#include "boxes/peers/add_participants_box.h"
|
||||
#include "boxes/peers/add_to_contacts_box.h"
|
||||
#include "boxes/peers/edit_contact_box.h"
|
||||
#include "ui/toast/toast.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
@ -345,7 +345,7 @@ void Filler::addBlockUser(not_null<UserData*> user) {
|
||||
} else if (user->isBot()) {
|
||||
user->session().api().blockUser(user);
|
||||
} else {
|
||||
window->show(Box(PeerMenuBlockUserBox, user, window));
|
||||
window->show(Box(PeerMenuBlockUserBox, window, user));
|
||||
}
|
||||
});
|
||||
|
||||
@ -363,6 +363,7 @@ void Filler::addBlockUser(not_null<UserData*> user) {
|
||||
}
|
||||
|
||||
void Filler::addUserActions(not_null<UserData*> user) {
|
||||
const auto window = &_controller->window()->controller();
|
||||
if (_source != PeerMenuSource::ChatsList) {
|
||||
if (Auth().supportMode()) {
|
||||
_addAction("Edit support info", [=] {
|
||||
@ -372,7 +373,7 @@ void Filler::addUserActions(not_null<UserData*> user) {
|
||||
if (!user->isContact() && !user->isSelf() && !user->isBot()) {
|
||||
_addAction(
|
||||
lang(lng_info_add_as_contact),
|
||||
[=] { PeerMenuAddContact(user); });
|
||||
[=] { window->show(Box(EditContactBox, window, user)); });
|
||||
}
|
||||
if (user->canShareThisContact()) {
|
||||
_addAction(
|
||||
@ -382,7 +383,7 @@ void Filler::addUserActions(not_null<UserData*> user) {
|
||||
if (user->isContact() && !user->isSelf()) {
|
||||
_addAction(
|
||||
lang(lng_info_edit_contact),
|
||||
[=] { Ui::show(Box<AddContactBox>(user)); });
|
||||
[=] { window->show(Box(EditContactBox, window, user)); });
|
||||
_addAction(
|
||||
lang(lng_info_delete_contact),
|
||||
[=] { PeerMenuDeleteContact(user); });
|
||||
@ -413,10 +414,11 @@ void Filler::addUserActions(not_null<UserData*> user) {
|
||||
|
||||
void Filler::addChatActions(not_null<ChatData*> chat) {
|
||||
if (_source != PeerMenuSource::ChatsList) {
|
||||
const auto controller = _controller;
|
||||
if (EditPeerInfoBox::Available(chat)) {
|
||||
const auto text = lang(lng_manage_group_title);
|
||||
_addAction(text, [=] {
|
||||
App::wnd()->sessionController()->showEditPeerBox(chat);
|
||||
controller->showEditPeerBox(chat);
|
||||
});
|
||||
}
|
||||
if (chat->canAddMembers()) {
|
||||
@ -456,11 +458,12 @@ void Filler::addChannelActions(not_null<ChannelData*> channel) {
|
||||
//}
|
||||
if (_source != PeerMenuSource::ChatsList) {
|
||||
if (EditPeerInfoBox::Available(channel)) {
|
||||
const auto controller = _controller;
|
||||
const auto text = lang(isGroup
|
||||
? lng_manage_group_title
|
||||
: lng_manage_channel_title);
|
||||
_addAction(text, [=] {
|
||||
App::wnd()->sessionController()->showEditPeerBox(channel);
|
||||
controller->showEditPeerBox(channel);
|
||||
});
|
||||
}
|
||||
if (channel->canAddMembers()) {
|
||||
@ -636,10 +639,6 @@ void PeerMenuDeleteContact(not_null<UserData*> user) {
|
||||
deleteSure));
|
||||
}
|
||||
|
||||
void PeerMenuAddContact(not_null<UserData*> user) {
|
||||
Ui::show(Box<AddToContactsBox>(&App::wnd()->controller(), user));
|
||||
}
|
||||
|
||||
void PeerMenuShareContactBox(not_null<UserData*> user) {
|
||||
const auto weak = std::make_shared<QPointer<PeerListBox>>();
|
||||
auto callback = [=](not_null<PeerData*> peer) {
|
||||
@ -706,8 +705,8 @@ void PeerMenuCreatePoll(not_null<PeerData*> peer) {
|
||||
|
||||
void PeerMenuBlockUserBox(
|
||||
not_null<GenericBox*> box,
|
||||
not_null<UserData*> user,
|
||||
not_null<Window::Controller*> window) {
|
||||
not_null<Window::Controller*> window,
|
||||
not_null<UserData*> user) {
|
||||
using Flag = MTPDpeerSettings::Flag;
|
||||
const auto settings = user->settings().value_or(Flag(0));
|
||||
|
||||
|
@ -50,14 +50,13 @@ void PeerMenuAddMuteAction(
|
||||
void PeerMenuExportChat(not_null<PeerData*> peer);
|
||||
void PeerMenuDeleteContact(not_null<UserData*> user);
|
||||
void PeerMenuShareContactBox(not_null<UserData*> user);
|
||||
void PeerMenuAddContact(not_null<UserData*> user);
|
||||
void PeerMenuAddChannelMembers(not_null<ChannelData*> channel);
|
||||
//void PeerMenuUngroupFeed(not_null<Data::Feed*> feed); // #feed
|
||||
void PeerMenuCreatePoll(not_null<PeerData*> peer);
|
||||
void PeerMenuBlockUserBox(
|
||||
not_null<GenericBox*> box,
|
||||
not_null<UserData*> user,
|
||||
not_null<Window::Controller*> window);
|
||||
not_null<Window::Controller*> window,
|
||||
not_null<UserData*> user);
|
||||
|
||||
void ToggleHistoryArchived(not_null<History*> history, bool archived);
|
||||
Fn<void()> ClearHistoryHandler(not_null<PeerData*> peer);
|
||||
|
@ -1,7 +1,7 @@
|
||||
<(src_loc)/boxes/peers/add_participants_box.cpp
|
||||
<(src_loc)/boxes/peers/add_participants_box.h
|
||||
<(src_loc)/boxes/peers/add_to_contacts_box.cpp
|
||||
<(src_loc)/boxes/peers/add_to_contacts_box.h
|
||||
<(src_loc)/boxes/peers/edit_contact_box.cpp
|
||||
<(src_loc)/boxes/peers/edit_contact_box.h
|
||||
<(src_loc)/boxes/peers/edit_linked_chat_box.cpp
|
||||
<(src_loc)/boxes/peers/edit_linked_chat_box.h
|
||||
<(src_loc)/boxes/peers/edit_participant_box.cpp
|
||||
|
Loading…
Reference in New Issue
Block a user