| 1129 | } |
| 1130 | |
| 1131 | void Filler::addTopicLink() { |
| 1132 | if (!_topic || _topic->creating()) { |
| 1133 | return; |
| 1134 | } |
| 1135 | const auto channel = _topic->channel(); |
| 1136 | if (!channel) { |
| 1137 | return; |
| 1138 | } |
| 1139 | const auto controller = _controller; |
| 1140 | const auto weak = base::make_weak(_topic); |
| 1141 | _addAction(tr::lng_context_copy_topic_link(tr::now), [=] { |
| 1142 | if (const auto strong = weak.get()) { |
| 1143 | const auto link = Info::Profile::TopicLink(strong, true); |
| 1144 | QGuiApplication::clipboard()->setText(link); |
| 1145 | controller->showToast(channel->hasUsername() |
| 1146 | ? tr::lng_channel_public_link_copied(tr::now) |
| 1147 | : tr::lng_context_about_private_link(tr::now)); |
| 1148 | } |
| 1149 | }, &st::menuIconCopy); |
| 1150 | } |
| 1151 | |
| 1152 | void Filler::addManageTopic() { |
| 1153 | if (!_topic || !_topic->canEdit()) { |