mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-04-11 04:01:18 +00:00
Added ability to copy link of public user.
This commit is contained in:
parent
7dac57cc0e
commit
f9dd8c182f
@ -27,6 +27,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/boxes/report_box.h"
|
||||
#include "ui/toast/toast.h"
|
||||
#include "ui/text/format_values.h"
|
||||
#include "ui/text/text_entity.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/widgets/labels.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
@ -196,6 +197,7 @@ private:
|
||||
void addExportChat();
|
||||
void addReport();
|
||||
void addNewContact();
|
||||
void addShareUsername();
|
||||
void addShareContact();
|
||||
void addEditContact();
|
||||
void addBotToGroup();
|
||||
@ -650,6 +652,27 @@ void Filler::addNewContact() {
|
||||
&st::menuIconInvite);
|
||||
}
|
||||
|
||||
void Filler::addShareUsername() {
|
||||
const auto user = _peer->asUser();
|
||||
if (!user || user->userName().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
_addAction(
|
||||
tr::lng_group_invite_share(tr::now),
|
||||
[=, controller = _controller] {
|
||||
const auto link = controller->session().createInternalLinkFull(
|
||||
user->userName());
|
||||
if (link.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
TextUtilities::SetClipboardText(TextForMimeData::Simple(link));
|
||||
Ui::Toast::Show(
|
||||
Window::Show(controller).toastParent(),
|
||||
tr::lng_username_copied(tr::now));
|
||||
},
|
||||
&st::menuIconShare);
|
||||
}
|
||||
|
||||
void Filler::addShareContact() {
|
||||
const auto user = _peer->asUser();
|
||||
if (!user || !user->canShareThisContact()) {
|
||||
@ -856,6 +879,7 @@ void Filler::fillProfileActions() {
|
||||
addSupportInfo();
|
||||
addNewContact();
|
||||
addShareContact();
|
||||
addShareUsername();
|
||||
addEditContact();
|
||||
addBotToGroup();
|
||||
addNewMembers();
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 6ae122f1b27332a27316892dada6050e2f225ad8
|
||||
Subproject commit 0a713c1c7b9d1890b98eb7c6d1e29bd199914ad7
|
Loading…
Reference in New Issue
Block a user