feat(chat): add a "Copy my chat address" button
The conversation header only copies a PEER's address, so a user had no way to hand out their own chat address for others to message them. Add a "Copy my chat address" link in the left pane (public App::chatMyAddress() forwards the stable seed-derived reply z-address; copied on click only, with an "address copied" toast and a warning if none exists yet). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -916,6 +916,24 @@ void RenderChatTab(App* app)
|
||||
if (ImGui::SmallButton(bl.c_str())) s_show_blocked = true;
|
||||
ImGui::PopStyleColor();
|
||||
}
|
||||
// "Copy my chat address" — the address others use to reach this user. The conversation header
|
||||
// only copies a PEER's address, so without this there's no way to hand out your own. Copies on
|
||||
// click only (chatMyAddress may persist a freshly chosen address).
|
||||
{
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, material::OnSurfaceMedium());
|
||||
// Text-only: SmallButton uses the body font, which has no Material icon glyph (would show "?").
|
||||
if (ImGui::SmallButton(TR("chat_copy_my_address"))) {
|
||||
std::string myAddr = app->chatMyAddress();
|
||||
if (myAddr.empty()) {
|
||||
Notifications::instance().warning(TR("chat_no_my_address"));
|
||||
} else {
|
||||
ImGui::SetClipboardText(myAddr.c_str());
|
||||
Notifications::instance().info(TR("address_copied"));
|
||||
}
|
||||
}
|
||||
ImGui::PopStyleColor();
|
||||
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("chat_my_address_tip"));
|
||||
}
|
||||
const std::string search = s_search;
|
||||
ImGui::Separator();
|
||||
if (convs.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user