From 2e54bc8f4b0e1defc404ca64c5eec42067ddec28 Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Sun, 5 Apr 2026 12:03:55 +0200 Subject: [PATCH] Fix Invite Button connect --- .../src/gui/People/PeopleDialog.cpp | 32 +++++++++++-------- retroshare-gui/src/gui/People/PeopleDialog.h | 1 + 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/retroshare-gui/src/gui/People/PeopleDialog.cpp b/retroshare-gui/src/gui/People/PeopleDialog.cpp index dd7e6b6cf..43c43dba0 100644 --- a/retroshare-gui/src/gui/People/PeopleDialog.cpp +++ b/retroshare-gui/src/gui/People/PeopleDialog.cpp @@ -645,18 +645,23 @@ void PeopleDialog::sendMessage() void PeopleDialog::sendInvite() { - QAction *action = - qobject_cast(QObject::sender()); - if (action) { - QString data = action->data().toString(); + RsGxsId gxs_id; - RsGxsId gxs_id = RsGxsId(data.toStdString());; - - MessageComposer::sendInvite(gxs_id,false); - - } - + // Check if triggered by a Context Menu Action + QAction *action = qobject_cast(QObject::sender()); + if (action) { + QString data = action->data().toString(); + gxs_id = RsGxsId(data.toStdString()); + } + // Otherwise, check if it was the UI Button + else { + gxs_id = mCurrentSelectedId; + } + // Execute the invite if the ID is valid + if (!gxs_id.isNull()) { + MessageComposer::sendInvite(gxs_id, false); + } } void PeopleDialog::addtoContacts() @@ -1383,13 +1388,13 @@ void PeopleDialog::loadIdentityLabels(const RsGxsIdGroup& data) void PeopleDialog::onIdentitySelected() { - // Determine which widget sent the signal IdentityWidget* widget = qobject_cast(sender()); if (widget) { - // Load the labels using the data from the clicked widget + // Save the ID for the Invite Button to use later + mCurrentSelectedId = RsGxsId(widget->groupInfo().mMeta.mGroupId); + // Load the labels this->loadIdentityLabels(widget->groupInfo()); - // Optional: Visually select it clearAllSelections(); widget->setIsSelected(true); } @@ -1443,3 +1448,4 @@ void PeopleDialog::modifyReputation() return; } + diff --git a/retroshare-gui/src/gui/People/PeopleDialog.h b/retroshare-gui/src/gui/People/PeopleDialog.h index 962d0866d..8bd0602bd 100644 --- a/retroshare-gui/src/gui/People/PeopleDialog.h +++ b/retroshare-gui/src/gui/People/PeopleDialog.h @@ -107,6 +107,7 @@ private: TokenQueue *mIdentityQueue; TokenQueue *mCirclesQueue; //RsGxsUpdateBroadcastBase *mCirclesBroadcastBase ; + RsGxsId mCurrentSelectedId; // Store the ID of the person currently clicked FlowLayout *_flowLayoutExt; std::map _gxs_identity_widgets ;