From d222cfe8e0f1a786d25f607ae96dd02d32161428 Mon Sep 17 00:00:00 2001 From: csoler Date: Fri, 26 Jul 2024 11:10:52 +0200 Subject: [PATCH 01/29] added compilation flag for RNP --- retroshare.pri | 2 ++ 1 file changed, 2 insertions(+) diff --git a/retroshare.pri b/retroshare.pri index 7858f67f6..b07eb671a 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -182,6 +182,8 @@ rs_deep_files_index_taglib:CONFIG -= no_rs_deep_files_index_taglib CONFIG *= no_rs_use_native_dialogs rs_use_native_dialogs:CONFIG -= no_rs_use_native_dialogs +CONFIG *= use_rnp + # To disable broadcast discovery append the following assignation to qmake # command line "CONFIG+=no_rs_broadcast_discovery" CONFIG *= rs_broadcast_discovery From 3361727a37eb9231ae39f39d0c73031071d75165 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 11 Aug 2024 16:43:20 +0200 Subject: [PATCH 02/29] added switch to compile with rnp or openpgp-sdk --- RetroShare.pro | 5 +---- retroshare.pri | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/RetroShare.pro b/RetroShare.pro index 944e8204e..4972fe2ab 100644 --- a/RetroShare.pro +++ b/RetroShare.pro @@ -25,9 +25,6 @@ CONFIG += c++14 TEMPLATE = subdirs -SUBDIRS += openpgpsdk -openpgpsdk.file = openpgpsdk/src/openpgpsdk.pro - rs_jsonapi:isEmpty(JSONAPI_GENERATOR_EXE) { SUBDIRS += jsonapi-generator jsonapi-generator.file = jsonapi-generator/src/jsonapi-generator.pro @@ -36,7 +33,7 @@ rs_jsonapi:isEmpty(JSONAPI_GENERATOR_EXE) { SUBDIRS += libbitdht libbitdht.file = libbitdht/src/libbitdht.pro -libretroshare.depends += openpgpsdk libbitdht +libretroshare.depends += libbitdht SUBDIRS += libretroshare libretroshare.file = libretroshare/src/libretroshare.pro diff --git a/retroshare.pri b/retroshare.pri index b07eb671a..f6a9f08e6 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -182,7 +182,10 @@ rs_deep_files_index_taglib:CONFIG -= no_rs_deep_files_index_taglib CONFIG *= no_rs_use_native_dialogs rs_use_native_dialogs:CONFIG -= no_rs_use_native_dialogs -CONFIG *= use_rnp +# By default, use RNP lib for RFC4880 PGP management. If not, compilation will +# default to openpgp-sdk, which is old and unmaintained, so probably not very secure. +CONFIG *= rs_rnplib +rs_no_rnplib:CONFIG -= use_rnp_lib # To disable broadcast discovery append the following assignation to qmake # command line "CONFIG+=no_rs_broadcast_discovery" @@ -851,6 +854,17 @@ isEmpty(RS_UPNP_LIB) { } } +rs_rnplib { + DEFINES += USE_RNP_LIB + message("Using RNP lib for PGP") +} else { + SUBDIRS += openpgpsdk + openpgpsdk.file = openpgpsdk/src/openpgpsdk.pro + libretroshare.depends += openpgpsdk + message("Using OpenPGP-SDK for PGP") +} + + equals(RS_UPNP_LIB, none):RS_UPNP_LIB= equals(RS_UPNP_LIB, miniupnpc):DEFINES*=RS_USE_LIBMINIUPNPC contains(RS_UPNP_LIB, upnp):DEFINES*=RS_USE_LIBUPNP From 37261761ddf26416958467740fe5a01d3598197f Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 11 Aug 2024 23:32:11 +0200 Subject: [PATCH 03/29] fixed compilation --- retroshare-friendserver/src/friendserver.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/retroshare-friendserver/src/friendserver.cc b/retroshare-friendserver/src/friendserver.cc index 19c286256..45574a1b9 100644 --- a/retroshare-friendserver/src/friendserver.cc +++ b/retroshare-friendserver/src/friendserver.cc @@ -8,7 +8,11 @@ #include "pgp/pgpkeyutil.h" #include "pgp/rscertificate.h" +#ifdef USE_RNP_LIB +#include "pgp/rnppgphandler.h" +#else #include "pgp/openpgpsdkhandler.h" +#endif #include "friendserver.h" #include "friend_server/fsitem.h" @@ -393,7 +397,11 @@ FriendServer::FriendServer(const std::string& base_dir,const std::string& listen std::string pgp_private_keyring_path = RsDirUtil::makePath(base_dir,"pgp_private_keyring") ; // not used. std::string pgp_trustdb_path = RsDirUtil::makePath(base_dir,"pgp_trustdb") ; // not used. +#ifdef USE_RNP_LIB + mPgpHandler = new RNPPGPHandler(pgp_public_keyring_path,pgp_private_keyring_path,pgp_trustdb_path,pgp_lock_path); +#else mPgpHandler = new OpenPGPSDKHandler(pgp_public_keyring_path,pgp_private_keyring_path,pgp_trustdb_path,pgp_lock_path); +#endif // Random bias. Should be cryptographically safe. From a9c87225e2771f4fae10670de90c371408949c43 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 19 Aug 2024 18:53:25 +0200 Subject: [PATCH 04/29] disabled certificate signature when using librnp --- retroshare-gui/src/gui/connect/PGPKeyDialog.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp index 36b6057b4..bcd0abea2 100644 --- a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp +++ b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp @@ -196,7 +196,12 @@ void PGPKeyDialog::load() ui.trustlevel_CB->show(); ui.is_signing_me->show(); ui.signersLabel->setText(tr("This key is signed by :")+" "); +#ifdef USE_RNP_LIB + ui.signKeyButton->setEnabled(false); + ui.signKeyButton->setToolTip("Disabled because key signing is not yet implemented in RNP lib"); +#else ui.signKeyButton->setEnabled(!detail.ownsign); +#endif if (detail.accept_connection) { From e20a4c4e60d40a8d31d575dbd3d93c519aa8a83a Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 18 Sep 2024 21:15:44 +0200 Subject: [PATCH 05/29] changed retroshare.pri to add V07_NON_BACKWARD_COMPATIBLE_CHANGE_005 by default --- retroshare.pri | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/retroshare.pri b/retroshare.pri index f6a9f08e6..6e4e36b4c 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -305,6 +305,12 @@ isEmpty(RS_THREAD_LIB):RS_THREAD_LIB = pthread # Why: Avoids sending probe packets # BackwardCompat: old RS before Mai 2019 will not be able to distant chat. # +# V07_NON_BACKWARD_COMPATIBLE_CHANGE_005: +# +# What: removes issuer fingerprint from signature subpackets +# Why: This type of subpacket is not part of RFC4880 and not recognised by OpenPGP-SDK +# BackwardCompat: old RS before Sept.2024 will not be able to exchange keys +# ########################################################################################################################################################### @@ -318,6 +324,7 @@ rs_v07_changes { DEFINES += V07_NON_BACKWARD_COMPATIBLE_CHANGE_002 DEFINES += V07_NON_BACKWARD_COMPATIBLE_CHANGE_003 DEFINES += V07_NON_BACKWARD_COMPATIBLE_CHANGE_004 + DEFINES += V07_NON_BACKWARD_COMPATIBLE_CHANGE_005 DEFINES += V07_NON_BACKWARD_COMPATIBLE_CHANGE_UNNAMED } From 126ce6607ebe7f20d1e35b89ecc9626908821b81 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 9 Oct 2024 21:31:42 +0200 Subject: [PATCH 06/29] changed flag name to remove it from v07 changes list --- retroshare.pri | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/retroshare.pri b/retroshare.pri index 6e4e36b4c..c64214ac0 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -305,11 +305,17 @@ isEmpty(RS_THREAD_LIB):RS_THREAD_LIB = pthread # Why: Avoids sending probe packets # BackwardCompat: old RS before Mai 2019 will not be able to distant chat. # -# V07_NON_BACKWARD_COMPATIBLE_CHANGE_005: +########################################################################################################################################################### + +########################################################################################################################################################### +# +# V06_EXPERIMENTAL_CHANGE_001: # # What: removes issuer fingerprint from signature subpackets # Why: This type of subpacket is not part of RFC4880 and not recognised by OpenPGP-SDK # BackwardCompat: old RS before Sept.2024 will not be able to exchange keys +# Note: Since signature subpacket 33 is part of the hashed section of the signature, this also invalidates the signature. +# Depending on the implementation, certificates with self-signature that miss this subpacket may not be accepted. # ########################################################################################################################################################### From ed0105f44ccd5cc693cdd390d5533e133704a549 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 22 Oct 2024 19:25:11 +0200 Subject: [PATCH 07/29] switched rs_usernp into rs_useopenpgpsdk --- retroshare-friendserver/src/friendserver.cc | 12 ++++++------ retroshare-gui/src/gui/connect/PGPKeyDialog.cpp | 6 +++--- retroshare.pri | 12 ++++++------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/retroshare-friendserver/src/friendserver.cc b/retroshare-friendserver/src/friendserver.cc index 45574a1b9..3c80bba83 100644 --- a/retroshare-friendserver/src/friendserver.cc +++ b/retroshare-friendserver/src/friendserver.cc @@ -8,10 +8,10 @@ #include "pgp/pgpkeyutil.h" #include "pgp/rscertificate.h" -#ifdef USE_RNP_LIB -#include "pgp/rnppgphandler.h" -#else +#ifdef USE_OPENPGPSDK #include "pgp/openpgpsdkhandler.h" +#else +#include "pgp/rnppgphandler.h" #endif #include "friendserver.h" @@ -397,10 +397,10 @@ FriendServer::FriendServer(const std::string& base_dir,const std::string& listen std::string pgp_private_keyring_path = RsDirUtil::makePath(base_dir,"pgp_private_keyring") ; // not used. std::string pgp_trustdb_path = RsDirUtil::makePath(base_dir,"pgp_trustdb") ; // not used. -#ifdef USE_RNP_LIB - mPgpHandler = new RNPPGPHandler(pgp_public_keyring_path,pgp_private_keyring_path,pgp_trustdb_path,pgp_lock_path); -#else +#ifdef USE_OPENPGPSDK mPgpHandler = new OpenPGPSDKHandler(pgp_public_keyring_path,pgp_private_keyring_path,pgp_trustdb_path,pgp_lock_path); +#else + mPgpHandler = new RNPPGPHandler(pgp_public_keyring_path,pgp_private_keyring_path,pgp_trustdb_path,pgp_lock_path); #endif // Random bias. Should be cryptographically safe. diff --git a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp index bcd0abea2..798578e0b 100644 --- a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp +++ b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp @@ -196,11 +196,11 @@ void PGPKeyDialog::load() ui.trustlevel_CB->show(); ui.is_signing_me->show(); ui.signersLabel->setText(tr("This key is signed by :")+" "); -#ifdef USE_RNP_LIB +#ifdef USE_OPENPGPSDK + ui.signKeyButton->setEnabled(!detail.ownsign); +#else ui.signKeyButton->setEnabled(false); ui.signKeyButton->setToolTip("Disabled because key signing is not yet implemented in RNP lib"); -#else - ui.signKeyButton->setEnabled(!detail.ownsign); #endif if (detail.accept_connection) diff --git a/retroshare.pri b/retroshare.pri index c64214ac0..0a75509a5 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -184,8 +184,8 @@ rs_use_native_dialogs:CONFIG -= no_rs_use_native_dialogs # By default, use RNP lib for RFC4880 PGP management. If not, compilation will # default to openpgp-sdk, which is old and unmaintained, so probably not very secure. -CONFIG *= rs_rnplib -rs_no_rnplib:CONFIG -= use_rnp_lib +CONFIG *= +rs_no_openpgpsdk:CONFIG -= use_openpgpsdk # To disable broadcast discovery append the following assignation to qmake # command line "CONFIG+=no_rs_broadcast_discovery" @@ -867,14 +867,14 @@ isEmpty(RS_UPNP_LIB) { } } -rs_rnplib { - DEFINES += USE_RNP_LIB - message("Using RNP lib for PGP") -} else { +rs_openpgpsdk { SUBDIRS += openpgpsdk openpgpsdk.file = openpgpsdk/src/openpgpsdk.pro libretroshare.depends += openpgpsdk message("Using OpenPGP-SDK for PGP") +} else { + DEFINES += USE_RNP_LIB + message("Using RNP lib for PGP") } From 3248a0613486a2391b7aaedda09afc144770b158 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 16 Nov 2024 15:02:48 +0100 Subject: [PATCH 08/29] updated master branch to latest version of submodules --- libretroshare | 2 +- openpgpsdk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libretroshare b/libretroshare index 402f32eda..5e3d142b0 160000 --- a/libretroshare +++ b/libretroshare @@ -1 +1 @@ -Subproject commit 402f32eda026c3ec3e429b5fb842e87ebd985d73 +Subproject commit 5e3d142b087151b3a6d05896a0244ba6352e9e44 diff --git a/openpgpsdk b/openpgpsdk index b41667912..df542663d 160000 --- a/openpgpsdk +++ b/openpgpsdk @@ -1 +1 @@ -Subproject commit b41667912751a453e8e5d4733215a0609277a26f +Subproject commit df542663d8bd698a8b5541fc6db07da6c59f1c3a From 00241d62525b98e4ca479db723d4b750c4007bfa Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 16 Nov 2024 15:47:08 +0100 Subject: [PATCH 09/29] Use all mails for the calculation of counts in MessagesDialog::updateMessageSummaryList, not just the current selected box --- retroshare-gui/src/gui/msgs/MessagesDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp index be9eedf6b..85611b585 100644 --- a/retroshare-gui/src/gui/msgs/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/msgs/MessagesDialog.cpp @@ -1296,7 +1296,7 @@ void MessagesDialog::updateMessageSummaryList() /* calculating the new messages */ std::list msgList; - rsMail->getMessageSummaries(mMessageModel->currentBox(),msgList); + rsMail->getMessageSummaries(Rs::Msgs::BoxName::BOX_ALL,msgList); QMap tagCount; From d8d2243b9e474a9f5e6b95b9aa4516c771cd64ee Mon Sep 17 00:00:00 2001 From: defnax Date: Sat, 16 Nov 2024 16:48:30 +0100 Subject: [PATCH 10/29] Improve People View --- retroshare-gui/src/gui/Identity/IdDialog.cpp | 10 +- retroshare-gui/src/gui/Identity/IdDialog.ui | 535 +++++++++---------- 2 files changed, 267 insertions(+), 278 deletions(-) diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 4793ff613..1f0eecc52 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -198,7 +198,7 @@ IdDialog::IdDialog(QWidget *parent) mStateHelper->addLoadPlaceholder(IDDIALOG_IDLIST, ui->idTreeWidget, false); mStateHelper->addClear(IDDIALOG_IDLIST, ui->idTreeWidget); - mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_Nickname); + //mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_Nickname); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_PublishTS); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_KeyId); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->lineEdit_Type); @@ -214,7 +214,7 @@ IdDialog::IdDialog(QWidget *parent) mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->label_positive); mStateHelper->addWidget(IDDIALOG_IDDETAILS, ui->label_negative); - mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_Nickname); + //mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_Nickname); mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_PublishTS); mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_KeyId); mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->lineEdit_Type); @@ -225,7 +225,7 @@ IdDialog::IdDialog(QWidget *parent) mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->overallOpinion_TF); mStateHelper->addLoadPlaceholder(IDDIALOG_IDDETAILS, ui->usageStatistics_TB); - mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_Nickname); + //mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_Nickname); mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_PublishTS); mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_KeyId); mStateHelper->addClear(IDDIALOG_IDDETAILS, ui->lineEdit_Type); @@ -481,11 +481,11 @@ void IdDialog::clearPerson() { //QFontMetricsF f(ui->avLabel_Person->font()) ; - //ui->avLabel_Person->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":/icons/png/people.png").scaled(f.height()*4,f.height()*4,Qt::KeepAspectRatio,Qt::SmoothTransformation)); ui->headerTextLabel_Person->setText(tr("People")); ui->info_Frame_Invite->hide(); ui->avatarLabel->clear(); + ui->avatarLabel->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":/icons/png/people.png")); whileBlocking(ui->ownOpinion_CB)->setCurrentIndex(1); whileBlocking(ui->autoBanIdentities_CB)->setChecked(false); @@ -1675,7 +1675,7 @@ void IdDialog::loadIdentity(RsGxsIdGroup data) RsPgpId ownPgpId = rsPeers->getGPGOwnId(); ui->lineEdit_PublishTS->setText(QDateTime::fromMSecsSinceEpoch(qint64(1000)*data.mMeta.mPublishTs).toString(Qt::SystemLocaleShortDate)); - ui->lineEdit_Nickname->setText(QString::fromUtf8(data.mMeta.mGroupName.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE)); + //ui->lineEdit_Nickname->setText(QString::fromUtf8(data.mMeta.mGroupName.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE)); ui->lineEdit_KeyId->setText(QString::fromStdString(data.mMeta.mGroupId.toStdString())); //ui->lineEdit_GpgHash->setText(QString::fromStdString(data.mPgpIdHash.toStdString())); if(data.mPgpKnown) diff --git a/retroshare-gui/src/gui/Identity/IdDialog.ui b/retroshare-gui/src/gui/Identity/IdDialog.ui index 1c504f8fc..37bb33556 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.ui +++ b/retroshare-gui/src/gui/Identity/IdDialog.ui @@ -302,14 +302,14 @@ 0 0 505 - 716 + 703 - + - 0 + 3 @@ -478,6 +478,265 @@ + + + + + 22 + + + + People + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse + + + + + + + + 0 + 0 + + + + + 0 + 299 + + + + + + + + 9 + + + + + Auto-Ban all identities signed by the same node + + + Auto-Ban profile + + + + + + + <html><head/><body><p>Average opinion of neighbor nodes about this identity. Negative is bad,</p><p>positive is good. Zero is neutral.</p></body></html> + + + true + + + + + + + Ban-option: + + + + + + + true + + + + + + + true + + + + + + + Identity ID : + + + + + + + Last used: + + + + + + + Qt::Horizontal + + + + + + + Owner node ID : + + + + + + + Created on : + + + + + + + Friend votes: + + + true + + + + + + + Type: + + + + + + + true + + + true + + + + + + + Your opinion: + + + + + + + Qt::Vertical + + + + 20 + 1 + + + + + + + + true + + + true + + + + + + + <html><head/><body><p><span style=" font-family:'Sans'; font-size:9pt;">Your own opinion about an identity rules the visibility of that identity for yourself and your friend nodes. Your own opinion is shared among friends and used to compute a reputation score: If your opinion about an identity is neutral, the reputation score is the difference between friend's positive and negative opinions. If not, your own opinion gives the score.</span></p><p><span style=" font-family:'Sans'; font-size:9pt;">The overall score is used in chat lobbies, forums and channels to decide on the actions to take for each specific identity. When the overall score is lower than -1, the identity is banned, which prevents all messages and forums/channels authored by this identity to be forwarded, both ways. Some forums also have special anti-spam flags that require a non negative reputation level, making them more sensitive to bad opinions. Banned identities gradually lose their activity and eventually disappear (after 5 days).</span></p><p><span style=" font-family:'Sans'; font-size:9pt;">You can change the thresholds and the time of inactivity to delete identities in preferences -&gt; people. </span></p></body></html> + + + + 22 + 22 + + + + + Negative + + + + :/icons/png/thumbs-down.png:/icons/png/thumbs-down.png + + + + + Neutral + + + + :/icons/png/thumbs-neutral.png:/icons/png/thumbs-neutral.png + + + + + Positive + + + + :/icons/png/thumbs-up.png:/icons/png/thumbs-up.png + + + + + + + + <html><head/><body><p>Overall reputation score, accounting for yours and your friends'.</p><p>Negative is bad, positive is good. Zero is neutral. If the score is too low,</p><p>the identity is flagged as bad, and will be filtered out in forums, chat lobbies,</p><p>channels, etc.</p></body></html> + + + true + + + + + + + Owner node name : + + + + + + + true + + + true + + + + + + + true + + + + + + + + 75 + true + + + + Overall: + + + + + + @@ -690,276 +949,6 @@ border-image: url(:/images/closepressed.png) - - - - - 0 - 0 - - - - - 0 - 299 - - - - Identity info - - - - - - true - - - true - - - - - - - Last used: - - - - - - - Identity name : - - - - - - - Owner node name : - - - - - - - true - - - true - - - - - - - Auto-Ban all identities signed by the same node - - - Auto-Ban profile - - - - - - - true - - - - - - - Your opinion: - - - - - - - true - - - - - - - true - - - - - - - - 75 - true - - - - Overall: - - - - - - - Created on : - - - - - - - Owner node ID : - - - - - - - Ban-option: - - - - - - - <html><head/><body><p>Average opinion of neighbor nodes about this identity. Negative is bad,</p><p>positive is good. Zero is neutral.</p></body></html> - - - true - - - - - - - Qt::Vertical - - - - 20 - 1 - - - - - - - - Identity ID : - - - - - - - Qt::Horizontal - - - - - - - true - - - true - - - - - - - Type: - - - - - - - <html><head/><body><p><span style=" font-family:'Sans'; font-size:9pt;">Your own opinion about an identity rules the visibility of that identity for yourself and your friend nodes. Your own opinion is shared among friends and used to compute a reputation score: If your opinion about an identity is neutral, the reputation score is the difference between friend's positive and negative opinions. If not, your own opinion gives the score.</span></p><p><span style=" font-family:'Sans'; font-size:9pt;">The overall score is used in chat lobbies, forums and channels to decide on the actions to take for each specific identity. When the overall score is lower than -1, the identity is banned, which prevents all messages and forums/channels authored by this identity to be forwarded, both ways. Some forums also have special anti-spam flags that require a non negative reputation level, making them more sensitive to bad opinions. Banned identities gradually lose their activity and eventually disappear (after 5 days).</span></p><p><span style=" font-family:'Sans'; font-size:9pt;">You can change the thresholds and the time of inactivity to delete identities in preferences -&gt; people. </span></p></body></html> - - - - 22 - 22 - - - - - Negative - - - - :/icons/png/thumbs-down.png:/icons/png/thumbs-down.png - - - - - Neutral - - - - :/icons/png/thumbs-neutral.png:/icons/png/thumbs-neutral.png - - - - - Positive - - - - :/icons/png/thumbs-up.png:/icons/png/thumbs-up.png - - - - - - - - true - - - true - - - - - - - <html><head/><body><p>Overall reputation score, accounting for yours and your friends'.</p><p>Negative is bad, positive is good. Zero is neutral. If the score is too low,</p><p>the identity is flagged as bad, and will be filtered out in forums, chat lobbies,</p><p>channels, etc.</p></body></html> - - - true - - - - - - - Friend votes: - - - true - - - - - - - - - - - 22 - - - - People - - - From 5c9bf3bf7c9aa018c85e9e68734723286864d1cc Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 20 Nov 2024 22:20:28 +0100 Subject: [PATCH 11/29] added commands to make rnp a submodule --- .gitmodules | 3 +++ supportlibs/librnp | 1 + 2 files changed, 4 insertions(+) create mode 160000 supportlibs/librnp diff --git a/.gitmodules b/.gitmodules index 7692f4556..46ab6b8bb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -36,3 +36,6 @@ [submodule "retroshare-webui"] path = retroshare-webui url = https://github.com/RetroShare/RSNewWebUI.git +[submodule "supportlibs/librnp"] + path = supportlibs/librnp + url = git@github.com:rnpgp/rnp.git diff --git a/supportlibs/librnp b/supportlibs/librnp new file mode 160000 index 000000000..3bd1b71b2 --- /dev/null +++ b/supportlibs/librnp @@ -0,0 +1 @@ +Subproject commit 3bd1b71b2a6138fbf21aa531349846024cbaec21 From 9a7c94314c29b3e7216851c6bf23ff87faa8eb8a Mon Sep 17 00:00:00 2001 From: fkobi Date: Mon, 25 Nov 2024 19:58:52 +0000 Subject: [PATCH 12/29] Improve desktop icon - add missing categories - sort according to https://specifications.freedesktop.org/menu-spec/latest/additional-category-registry.html --- data/retroshare.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/retroshare.desktop b/data/retroshare.desktop index efc73dd6b..2cfe1f12e 100644 --- a/data/retroshare.desktop +++ b/data/retroshare.desktop @@ -7,5 +7,5 @@ Exec=/usr/bin/retroshare %U Icon=/usr/share/pixmaps/retroshare.xpm Terminal=false Type=Application -Categories=Application;Network;P2P;Feed;Chat;InstantMessaging +Categories=Application;Network;Email;InstantMessaging;Chat;Feed;FileTransfer;P2P MimeType=x-scheme-handler/retroshare; From 6a77d6b7bc5a5a0b2c4d15cf77398d8dcf375e75 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 26 Nov 2024 22:19:02 +0100 Subject: [PATCH 13/29] fixed retroshare.pri --- retroshare.pri | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/retroshare.pri b/retroshare.pri index 0a75509a5..22bf11d3f 100644 --- a/retroshare.pri +++ b/retroshare.pri @@ -184,8 +184,9 @@ rs_use_native_dialogs:CONFIG -= no_rs_use_native_dialogs # By default, use RNP lib for RFC4880 PGP management. If not, compilation will # default to openpgp-sdk, which is old and unmaintained, so probably not very secure. -CONFIG *= -rs_no_openpgpsdk:CONFIG -= use_openpgpsdk +CONFIG *= rs_rnplib +rs_no_rnplib:CONFIG -= rs_rnplib +rs_no_rnplib:CONFIG += rs_openpgpsdk # To disable broadcast discovery append the following assignation to qmake # command line "CONFIG+=no_rs_broadcast_discovery" @@ -872,7 +873,9 @@ rs_openpgpsdk { openpgpsdk.file = openpgpsdk/src/openpgpsdk.pro libretroshare.depends += openpgpsdk message("Using OpenPGP-SDK for PGP") -} else { +} + +rs_rnplib { DEFINES += USE_RNP_LIB message("Using RNP lib for PGP") } From 8e94a99a535d56a1e70c59c350b91e8baae7c70b Mon Sep 17 00:00:00 2001 From: fkobi Date: Sat, 30 Nov 2024 15:14:41 +0000 Subject: [PATCH 14/29] Mention "desktop" instead of "GNOME" --- retroshare-gui/src/gui/StartDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/StartDialog.cpp b/retroshare-gui/src/gui/StartDialog.cpp index bc98527da..237d1bb83 100644 --- a/retroshare-gui/src/gui/StartDialog.cpp +++ b/retroshare-gui/src/gui/StartDialog.cpp @@ -161,7 +161,7 @@ void StartDialog::notSecureWarning() QMessageBox::warning ( this, tr("Warning"), tr("The password to your SSL certificate (your node) will be stored encrypted in your Keychain. \n\n Your PGP passwd will not be stored.\n\nThis choice can be reverted in settings."), QMessageBox::Ok); #else // this handles all linux systems at once. - QMessageBox::warning ( this, tr("Warning"), tr("The password to your SSL certificate (your node) will be stored encrypted in your Gnome Keyring. \n\n Your PGP passwd will not be stored.\n\nThis choice can be reverted in settings."), QMessageBox::Ok); + QMessageBox::warning ( this, tr("Warning"), tr("The password to your SSL certificate (your node) will be stored encrypted in your desktop's keyring. \n\n Your PGP passwd will not be stored.\n\nThis choice can be reverted in settings."), QMessageBox::Ok); #endif #endif } From 5d7b2359415f162161d087823bfc2ab0e71906bb Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 7 Dec 2024 16:37:37 +0100 Subject: [PATCH 15/29] added back key certification with RNP --- retroshare-gui/src/gui/connect/PGPKeyDialog.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp index 798578e0b..36b6057b4 100644 --- a/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp +++ b/retroshare-gui/src/gui/connect/PGPKeyDialog.cpp @@ -196,12 +196,7 @@ void PGPKeyDialog::load() ui.trustlevel_CB->show(); ui.is_signing_me->show(); ui.signersLabel->setText(tr("This key is signed by :")+" "); -#ifdef USE_OPENPGPSDK ui.signKeyButton->setEnabled(!detail.ownsign); -#else - ui.signKeyButton->setEnabled(false); - ui.signKeyButton->setToolTip("Disabled because key signing is not yet implemented in RNP lib"); -#endif if (detail.accept_connection) { From d79ce90c68af88d47804ceaf2e21b7ab3be385a6 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Thu, 19 Dec 2024 00:31:00 +0100 Subject: [PATCH 16/29] Fixed Windows build with librnp --- build_scripts/Windows-msys2/build/build.bat | 2 + build_scripts/Windows-msys2/build/pack.bat | 1 + build_scripts/Windows/build-libs/Makefile | 58 ++++++++++++++++++- build_scripts/Windows/build/pack.bat | 1 + .../Windows/installer/retroshare-Qt5.nsi | 1 + 5 files changed, 62 insertions(+), 1 deletion(-) diff --git a/build_scripts/Windows-msys2/build/build.bat b/build_scripts/Windows-msys2/build/build.bat index 4fdaff09f..bf68f3e20 100644 --- a/build_scripts/Windows-msys2/build/build.bat +++ b/build_scripts/Windows-msys2/build/build.bat @@ -18,6 +18,8 @@ if errorlevel 1 goto error_env if not "%ParamNoupdate%"=="1" ( :: Install needed things %EnvMSYS2Cmd% "pacman --noconfirm --needed -S make git mingw-w64-%RsMSYS2Architecture%-toolchain mingw-w64-%RsMSYS2Architecture%-qt5 mingw-w64-%RsMSYS2Architecture%-miniupnpc mingw-w64-%RsMSYS2Architecture%-sqlcipher mingw-w64-%RsMSYS2Architecture%-cmake mingw-w64-%RsMSYS2Architecture%-rapidjson" + :: rnp + %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-json-c mingw-w64-%RsMSYS2Architecture%-libbotan" :: Webui if "%ParamWebui%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-doxygen" diff --git a/build_scripts/Windows-msys2/build/pack.bat b/build_scripts/Windows-msys2/build/pack.bat index 313da7479..a898832f7 100644 --- a/build_scripts/Windows-msys2/build/pack.bat +++ b/build_scripts/Windows-msys2/build/pack.bat @@ -105,6 +105,7 @@ copy "%RsBuildPath%\retroshare-nogui\src\%RsBuildConfig%\retroshare*-nogui.exe" copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite% copy "%RsBuildPath%\supportlibs\cmark\build\src\libcmark.dll" "%RsDeployPath%" %Quite% if exist "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" copy "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" "%RsDeployPath%" %Quite% +if exist "%RsBuildPath%\supportlibs\librnp\Build\src\lib\librnp.dll" copy "%RsBuildPath%\supportlibs\librnp\Build\src\lib\librnp.dll" "%RsDeployPath%" %Quite% if exist "%RsBuildPath%\retroshare-friendserver\src\%RsBuildConfig%\retroshare-friendserver.exe" ( copy "%RsBuildPath%\retroshare-friendserver\src\%RsBuildConfig%\retroshare-friendserver.exe" "%RsDeployPath%" %Quite% ) diff --git a/build_scripts/Windows/build-libs/Makefile b/build_scripts/Windows/build-libs/Makefile index 0075770cd..33fd0218b 100644 --- a/build_scripts/Windows/build-libs/Makefile +++ b/build_scripts/Windows/build-libs/Makefile @@ -13,12 +13,18 @@ LIBMICROHTTPD_VERSION=0.9.75 FFMPEG_VERSION=4.4 RAPIDJSON_VERSION=1.1.0 XAPIAN_VERSION=1.4.19 +#RNP_VERSION=0.17.1 + +# libaries for rnp +JSON_C_VERSION=0.18 +BOTAN_VERSION=2.19.5 DOWNLOAD_PATH?=download BUILD_PATH=build LIBS_PATH?=libs -all: dirs zlib bzip2 miniupnpc openssl speex speexdsp libxml2 libxslt curl sqlcipher libmicrohttpd ffmpeg rapidjson xapian copylibs +all: dirs zlib bzip2 miniupnpc openssl speex speexdsp libxml2 libxslt curl sqlcipher libmicrohttpd ffmpeg rapidjson xapian jsonc botan copylibs +#rnp download: \ $(DOWNLOAD_PATH)/zlib-$(ZLIB_VERSION).tar.gz \ @@ -363,6 +369,56 @@ $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION): $(DOWNLOAD_PATH)/xapian-core-$(XAPI rm -r -f xapian-core-$(XAPIAN_VERSION) mv $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION).tmp $(BUILD_PATH)/xapian-core-$(XAPIAN_VERSION) +jsonc: $(BUILD_PATH)/json-c-$(JSON_C_VERSION) + +$(BUILD_PATH)/json-c-$(JSON_C_VERSION): + # prepare + rm -r -f $(BUILD_PATH)/rnp-* + [ -d "json-c-$(JSON_C_VERSION)" ] || git clone https://github.com/json-c/json-c.git --depth=1 --branch json-c-$(JSON_C_VERSION) "json-c-$(JSON_C_VERSION)" + # build json-c + mkdir -p json-c-$(JSON_C_VERSION)/build + cd json-c-$(JSON_C_VERSION)/build && cmake .. -G"MSYS Makefiles" -Wno-dev -DCMAKE_BUILD_TYPE="release" -DBUILD_SHARED_LIBS=off -DBUILD_STATIC_LIBS=on -DBUILD_TESTING=off -DCMAKE_CXX_FLAGS="-D__MINGW_USE_VC2005_COMPAT" -DCMAKE_INSTALL_PREFIX="`pwd`/install" -DCMAKE_INSTALL_PREFIX="`pwd`/../../$(BUILD_PATH)/json-c-$(JSON_C_VERSION).tmp" + cd json-c-$(JSON_C_VERSION)/build && make install + # cleanup + rm -r -f json-c-$(JSON_C_VERSION) + mv $(BUILD_PATH)/json-c-$(JSON_C_VERSION).tmp $(BUILD_PATH)/json-c-$(JSON_C_VERSION) + +botan: $(BUILD_PATH)/botan-$(BOTAN_VERSION) + +$(BUILD_PATH)/botan-$(BOTAN_VERSION): + # prepare + pacman --needed --noconfirm -S python3 + rm -r -f $(BUILD_PATH)/rnp-* + [ -d "botan-$(BOTAN_VERSION)" ] || git clone https://github.com/randombit/botan.git --depth=1 --branch $(BOTAN_VERSION) "botan-$(BOTAN_VERSION)" + # build botan + if [ $(MSYSTEM) = "MINGW32" ] ; then cd botan-$(BOTAN_VERSION) && ./configure.py --os=mingw --cpu=x86_32 --disable-shared-library --enable-static-library --extra-cxxflags="-D__MINGW_USE_VC2005_COMPAT" --prefix="`pwd`/../$(BUILD_PATH)/botan-$(BOTAN_VERSION).tmp" ; fi + if [ $(MSYSTEM) = "MINGW64" ] ; then cd botan-$(BOTAN_VERSION) && ./configure.py --os=mingw --cpu=x86_64 --disable-shared-library --enable-static-library --prefix="`pwd`/../$(BUILD_PATH)/botan-$(BOTAN_VERSION).tmp" ; fi + cd botan-$(BOTAN_VERSION) && make install + # cleanup + rm -r -f botan-$(BOTAN_VERSION) + mv $(BUILD_PATH)/botan-$(BOTAN_VERSION).tmp $(BUILD_PATH)/botan-$(BOTAN_VERSION) + +rnp: $(BUILD_PATH)/rnp-$(RNP_VERSION) + +$(BUILD_PATH)/rnp-$(RNP_VERSION): + # prepare + [ -d "rnp-$(RNP_VERSION)" ] || git clone https://github.com/rnpgp/rnp.git --depth=1 --branch v$(RNP_VERSION) --recurse-submodules --shallow-submodules "rnp-$(RNP_VERSION)" + # build + mkdir -p rnp-$(RNP_VERSION)/build + cd rnp-$(RNP_VERSION)/build && cmake .. -G"MSYS Makefiles" -Wno-dev -DCMAKE_INSTALL_PREFIX="`pwd`/install" -DBUILD_SHARED_LIBS=yes -DBUILD_TESTING=off -DCMAKE_CXX_FLAGS="-D__MINGW_USE_VC2005_COMPAT -D__STDC_FORMAT_MACROS" -DBZIP2_INCLUDE_DIR="`pwd`/../../$(BUILD_PATH)/bzip2-$(BZIP2_VERSION)/include" -DBZIP2_LIBRARY_RELEASE="`pwd`/../../$(BUILD_PATH)/bzip2-$(BZIP2_VERSION)/lib/libbz2.a" -DBZIP2_LIBRARIES="`pwd`/../../$(BUILD_PATH)/bzip2-$(BZIP2_VERSION)/lib/libbz2.a" -DZLIB_INCLUDE_DIR="`pwd`/../../$(BUILD_PATH)/zlib-$(ZLIB_VERSION)/include" -DZLIB_LIBRARY="`pwd`/../../$(BUILD_PATH)/zlib-$(ZLIB_VERSION)/lib/libz.a" -DJSON-C_INCLUDE_DIR="`pwd`/../../$(BUILD_PATH)/json-c-$(JSON_C_VERSION)/include/json-c" -DJSON-C_LIBRARY="`pwd`/../../$(BUILD_PATH)/json-c-$(JSON_C_VERSION)/lib/libjson-c.a" -DBOTAN_INCLUDE_DIR="`pwd`/../../$(BUILD_PATH)/botan-$(BOTAN_VERSION)/include/botan-`echo $(BOTAN_VERSION) | cut -c1-1`" -DBOTAN_LIBRARY="`pwd`/../../$(BUILD_PATH)/botan-$(BOTAN_VERSION)/lib/libbotan-`echo $(BOTAN_VERSION) | cut -c1-1`.a" + cmake --build rnp-$(RNP_VERSION)/build + # copy files + mkdir -p $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/include/rnp + cp -r rnp-$(RNP_VERSION)/include/rnp/* $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/include/rnp/ + cp -r rnp-$(RNP_VERSION)/build/src/lib/rnp/* $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/include/rnp/ + mkdir -p $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/lib + cp -r rnp-$(RNP_VERSION)/build/src/lib/librnp.dll.a $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/lib/ + mkdir -p $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/bin + cp -r rnp-$(RNP_VERSION)/build/src/lib/librnp.dll $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp/bin/ + # cleanup + rm -r -f rnp-$(RNP_VERSION) + mv $(BUILD_PATH)/rnp-$(RNP_VERSION).tmp $(BUILD_PATH)/rnp-$(RNP_VERSION) + copylibs: rm -r -f $(LIBS_PATH) ; \ mkdir -p $(LIBS_PATH) ; \ diff --git a/build_scripts/Windows/build/pack.bat b/build_scripts/Windows/build/pack.bat index 1c844efa0..ff347babf 100644 --- a/build_scripts/Windows/build/pack.bat +++ b/build_scripts/Windows/build/pack.bat @@ -96,6 +96,7 @@ copy nul "%RsDeployPath%\portable" %Quite% echo copy binaries copy "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\retroshare*.exe" "%RsDeployPath%" %Quite% if exist "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" copy "%RsBuildPath%\libretroshare\src\lib\retroshare.dll" "%RsDeployPath%" %Quite% +if exist "%RsBuildPath%\supportlibs\librnp\Build\src\lib\librnp.dll" copy "%RsBuildPath%\supportlibs\librnp\Build\src\lib\librnp.dll" "%RsDeployPath%" %Quite% if "%ParamService%"=="1" ( copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite% diff --git a/build_scripts/Windows/installer/retroshare-Qt5.nsi b/build_scripts/Windows/installer/retroshare-Qt5.nsi index 63c81bbcc..c7a5b9554 100644 --- a/build_scripts/Windows/installer/retroshare-Qt5.nsi +++ b/build_scripts/Windows/installer/retroshare-Qt5.nsi @@ -247,6 +247,7 @@ Section $(Section_Main) Section_Main ; External binaries File "${EXTERNAL_LIB_DIR}\bin\miniupnpc.dll" + File "${RELEASEDIR}\supportlibs\librnp\Build\src\lib\librnp.dll" !if ${ARCHITECTURE} == "x86" File "${EXTERNAL_LIB_DIR}\bin\libcrypto-1_1.dll" File "${EXTERNAL_LIB_DIR}\bin\libssl-1_1.dll" From d6d2f096730339a180b129dc81bc0bff486c4672 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 19 Dec 2024 22:25:27 +0100 Subject: [PATCH 17/29] updated submodule url to comply with RS standard --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 46ab6b8bb..9a68ca0cb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -38,4 +38,4 @@ url = https://github.com/RetroShare/RSNewWebUI.git [submodule "supportlibs/librnp"] path = supportlibs/librnp - url = git@github.com:rnpgp/rnp.git + url = https://github.com/rnpgp/rnp.git From 142049a61e427e8944ba1e21a0e810c2d52e9a69 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 26 Dec 2024 18:42:18 +0100 Subject: [PATCH 18/29] updated master branch to latest commit in libretroshare submodule --- libretroshare | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretroshare b/libretroshare index 5e3d142b0..2a4df811f 160000 --- a/libretroshare +++ b/libretroshare @@ -1 +1 @@ -Subproject commit 5e3d142b087151b3a6d05896a0244ba6352e9e44 +Subproject commit 2a4df811f6bfe1904bc3956f285aa0fc891f9fd4 From 433ab6514de29ee817a0fbe66af6b2ef76209802 Mon Sep 17 00:00:00 2001 From: csoler Date: Thu, 26 Dec 2024 21:14:49 +0100 Subject: [PATCH 19/29] fixed bug causing own identity to not disappear when deleted --- retroshare-gui/src/gui/Identity/IdDialog.cpp | 34 +++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 5397f6300..b0d8f1863 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -429,14 +429,23 @@ void IdDialog::handleEvent_main_thread(std::shared_ptr event) switch(e->mIdentityEventCode) { case RsGxsIdentityEventCode::DELETED_IDENTITY: - case RsGxsIdentityEventCode::NEW_IDENTITY: + if(mId == e->mIdentityId) + { + mId.clear(); + updateIdentity(); + } + updateIdList(); + break; + + case RsGxsIdentityEventCode::NEW_IDENTITY: case RsGxsIdentityEventCode::UPDATED_IDENTITY: if (isVisible()) { if(rsIdentity->isOwnId(RsGxsId(e->mIdentityId))) updateIdList(); else - updateIdTimer.start(3000); // use a timer for events not generated by local changes + updateIdTimer.start(3000); // use a timer for events not generated by local changes which generally + // come in large herds. Allows to group multiple changes into a single UI update. } else needUpdateIdsOnNextShow = true; @@ -1330,6 +1339,7 @@ void IdDialog::updateSelection() void IdDialog::updateIdList() { //int accept = filter; + std::cerr << "Updating ID list" << std::endl; RsThread::async([this]() { @@ -1512,7 +1522,9 @@ void IdDialog::loadIdentities(const std::map& ids_set { auto ids_set(ids_set_const); - //First: Get current item to restore after + std::cerr << "Loading ID list" << std::endl; + + //First: Get current item to restore after RsGxsGroupId oldCurrentId = mIdToNavigate; { QTreeWidgetItem *oldCurrent = ui->idTreeWidget->currentItem(); @@ -1598,9 +1610,9 @@ void IdDialog::loadIdentities(const std::map& ids_set int allCount = allItem->childCount() ; int ownCount = ownItem->childCount(); - contactsItem->setText(0, tr("My contacts") + " (" + QString::number( contactsCount ) + ")" ); - allItem->setText(0, tr("All") + " (" + QString::number( allCount ) + ")" ); - ownItem->setText(0, tr("My own identities") + " (" + QString::number( ownCount ) + ")" ); + contactsItem->setText(0, tr("My contacts") + ((contactsCount>0)?" (" + QString::number( contactsCount ) + ")":"") ); + allItem->setText(0, tr("All") + ((allCount>0)?" (" + QString::number( allCount ) + ")":"") ); + ownItem->setText(0, tr("My own identities") + ((ownCount>0)?" (" + QString::number( ownCount ) + ")":"") ); //Restore expanding @@ -2086,14 +2098,12 @@ void IdDialog::removeIdentity() return; } - if ((QMessageBox::question(this, tr("Really delete?"), tr("Do you really want to delete this identity?"), QMessageBox::Yes|QMessageBox::No, QMessageBox::No))== QMessageBox::Yes) + if ((QMessageBox::question(this, tr("Really delete?"), tr("Do you really want to delete this identity?\nThis cannot be undone."), QMessageBox::Yes|QMessageBox::No, QMessageBox::No))== QMessageBox::Yes) { - std::string keyId = item->text(RSID_COL_KEYID).toStdString(); + std::string keyId = item->text(RSID_COL_KEYID).toStdString(); + RsGxsId kid(keyId); - uint32_t dummyToken = 0; - RsGxsIdGroup group; - group.mMeta.mGroupId=RsGxsGroupId(keyId); - rsIdentity->deleteIdentity(dummyToken, group); + rsIdentity->deleteIdentity(kid); } } From 6825c7e92517a11f4e8ea1c26be9f27f5d00e5a4 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Fri, 27 Dec 2024 10:09:09 +0100 Subject: [PATCH 20/29] Updated librnp submodule --- supportlibs/librnp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supportlibs/librnp b/supportlibs/librnp index 3bd1b71b2..ec7811726 160000 --- a/supportlibs/librnp +++ b/supportlibs/librnp @@ -1 +1 @@ -Subproject commit 3bd1b71b2a6138fbf21aa531349846024cbaec21 +Subproject commit ec78117269461b2cdce15a085033a8c6bff6d7e3 From 6cde715e668ab922089dcf89b2addf33c3c9a779 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 26 Oct 2024 12:44:51 +0200 Subject: [PATCH 21/29] Windows build: Updated MSYS2 installer to 20241208 --- build_scripts/Windows-msys2/env/tools/prepare-msys2.bat | 2 +- build_scripts/Windows/env/tools/prepare-msys2.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build_scripts/Windows-msys2/env/tools/prepare-msys2.bat b/build_scripts/Windows-msys2/env/tools/prepare-msys2.bat index eaeba1482..cea1df073 100644 --- a/build_scripts/Windows-msys2/env/tools/prepare-msys2.bat +++ b/build_scripts/Windows-msys2/env/tools/prepare-msys2.bat @@ -16,7 +16,7 @@ if "%~1"=="clean" ( goto exit ) -set MSYS2Version=20231026 +set MSYS2Version=20241208 set MSYS2Install=msys2-base-x86_64-%MSYS2Version%.sfx.exe set MSYS2Url=https://github.com/msys2/msys2-installer/releases/download/%MSYS2Version:~0,4%-%MSYS2Version:~4,2%-%MSYS2Version:~6,2%/%MSYS2Install% diff --git a/build_scripts/Windows/env/tools/prepare-msys2.bat b/build_scripts/Windows/env/tools/prepare-msys2.bat index 25f00ac30..48f827748 100644 --- a/build_scripts/Windows/env/tools/prepare-msys2.bat +++ b/build_scripts/Windows/env/tools/prepare-msys2.bat @@ -16,7 +16,7 @@ if "%~1"=="clean" ( goto exit ) -set MSYS2Version=20231026 +set MSYS2Version=20241208 set MSYS2Install=msys2-base-x86_64-%MSYS2Version%.sfx.exe set MSYS2Url=https://github.com/msys2/msys2-installer/releases/download/%MSYS2Version:~0,4%-%MSYS2Version:~4,2%-%MSYS2Version:~6,2%/%MSYS2Install% From 32a43b1892aa05aaf7b7ac37d2ea3644d4ddbdfa Mon Sep 17 00:00:00 2001 From: thunder2 Date: Thu, 15 Aug 2024 00:04:26 +0200 Subject: [PATCH 22/29] Windows build: Updated cmake to 3.31.3 --- build_scripts/Windows/env/tools/prepare-msys2.bat | 4 ++-- build_scripts/Windows/env/tools/prepare-tools.bat | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build_scripts/Windows/env/tools/prepare-msys2.bat b/build_scripts/Windows/env/tools/prepare-msys2.bat index 48f827748..ba2f12ce6 100644 --- a/build_scripts/Windows/env/tools/prepare-msys2.bat +++ b/build_scripts/Windows/env/tools/prepare-msys2.bat @@ -21,8 +21,8 @@ set MSYS2Version=20241208 set MSYS2Install=msys2-base-x86_64-%MSYS2Version%.sfx.exe set MSYS2Url=https://github.com/msys2/msys2-installer/releases/download/%MSYS2Version:~0,4%-%MSYS2Version:~4,2%-%MSYS2Version:~6,2%/%MSYS2Install% set MSYS2UnpackPath=%EnvMSYS2Path%\msys64 -set CMakeInstall=cmake-3.19.0-win32-x86.zip -set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.19.0/%CMakeInstall% +set CMakeInstall=cmake-3.31.3-windows-i386.zip +set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.31.3/%CMakeInstall% if exist "%MSYS2UnpackPath%\usr\bin\pacman.exe" ( if "%~1"=="reinstall" ( diff --git a/build_scripts/Windows/env/tools/prepare-tools.bat b/build_scripts/Windows/env/tools/prepare-tools.bat index 88549faed..f088acfa8 100644 --- a/build_scripts/Windows/env/tools/prepare-tools.bat +++ b/build_scripts/Windows/env/tools/prepare-tools.bat @@ -19,9 +19,9 @@ set MinGitInstallPath=%EnvToolsPath%\MinGit set DoxygenInstall=doxygen-1.9.6.windows.x64.bin.zip set DoxygenUrl=https://github.com/doxygen/doxygen/releases/download/Release_1_9_6/%DoxygenInstall% set DoxygenInstallPath=%EnvToolsPath%\doxygen -set CMakeVersion=cmake-3.19.0-win32-x86 +set CMakeVersion=cmake-3.31.3-windows-i386 set CMakeInstall=%CMakeVersion%.zip -set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.19.0/%CMakeInstall% +set CMakeUrl=https://github.com/Kitware/CMake/releases/download/v3.31.3/%CMakeInstall% set CMakeInstallPath=%EnvToolsPath%\cmake set TorProjectUrl=https://www.torproject.org set TorDownloadIndexUrl=%TorProjectUrl%/download/tor From ccd1cfbde69f681f9c20589d903ff58d8a3ad6ee Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 28 Nov 2023 14:45:12 +0100 Subject: [PATCH 23/29] Added missing calls to preMods in RsFriendListModel::setDisplayStatusString and RsFriendListModel::setDisplayStatusIcon --- retroshare-gui/src/gui/common/FriendListModel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/retroshare-gui/src/gui/common/FriendListModel.cpp b/retroshare-gui/src/gui/common/FriendListModel.cpp index 35cefa7ac..9ea271f86 100644 --- a/retroshare-gui/src/gui/common/FriendListModel.cpp +++ b/retroshare-gui/src/gui/common/FriendListModel.cpp @@ -162,12 +162,14 @@ static QIcon createAvatar(const QPixmap &avatar, const QPixmap &overlay) void RsFriendListModel::setDisplayStatusString(bool b) { + preMods(); mDisplayStatusString = b; postMods(); } void RsFriendListModel::setDisplayStatusIcon(bool b) { + preMods(); mDisplayStatusIcon = b; postMods(); } From b502dd71e2efef37ad13edbb80bffbad7a26eb9c Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 28 Dec 2024 13:59:34 +0100 Subject: [PATCH 24/29] Windows build: Fixed makefile for external libraries --- build_scripts/Windows/build-libs/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build_scripts/Windows/build-libs/Makefile b/build_scripts/Windows/build-libs/Makefile index 33fd0218b..534356914 100644 --- a/build_scripts/Windows/build-libs/Makefile +++ b/build_scripts/Windows/build-libs/Makefile @@ -373,9 +373,9 @@ jsonc: $(BUILD_PATH)/json-c-$(JSON_C_VERSION) $(BUILD_PATH)/json-c-$(JSON_C_VERSION): # prepare - rm -r -f $(BUILD_PATH)/rnp-* + rm -r -f $(BUILD_PATH)/json-c-* [ -d "json-c-$(JSON_C_VERSION)" ] || git clone https://github.com/json-c/json-c.git --depth=1 --branch json-c-$(JSON_C_VERSION) "json-c-$(JSON_C_VERSION)" - # build json-c + # build mkdir -p json-c-$(JSON_C_VERSION)/build cd json-c-$(JSON_C_VERSION)/build && cmake .. -G"MSYS Makefiles" -Wno-dev -DCMAKE_BUILD_TYPE="release" -DBUILD_SHARED_LIBS=off -DBUILD_STATIC_LIBS=on -DBUILD_TESTING=off -DCMAKE_CXX_FLAGS="-D__MINGW_USE_VC2005_COMPAT" -DCMAKE_INSTALL_PREFIX="`pwd`/install" -DCMAKE_INSTALL_PREFIX="`pwd`/../../$(BUILD_PATH)/json-c-$(JSON_C_VERSION).tmp" cd json-c-$(JSON_C_VERSION)/build && make install @@ -388,9 +388,9 @@ botan: $(BUILD_PATH)/botan-$(BOTAN_VERSION) $(BUILD_PATH)/botan-$(BOTAN_VERSION): # prepare pacman --needed --noconfirm -S python3 - rm -r -f $(BUILD_PATH)/rnp-* + rm -r -f $(BUILD_PATH)/botan-* [ -d "botan-$(BOTAN_VERSION)" ] || git clone https://github.com/randombit/botan.git --depth=1 --branch $(BOTAN_VERSION) "botan-$(BOTAN_VERSION)" - # build botan + # build if [ $(MSYSTEM) = "MINGW32" ] ; then cd botan-$(BOTAN_VERSION) && ./configure.py --os=mingw --cpu=x86_32 --disable-shared-library --enable-static-library --extra-cxxflags="-D__MINGW_USE_VC2005_COMPAT" --prefix="`pwd`/../$(BUILD_PATH)/botan-$(BOTAN_VERSION).tmp" ; fi if [ $(MSYSTEM) = "MINGW64" ] ; then cd botan-$(BOTAN_VERSION) && ./configure.py --os=mingw --cpu=x86_64 --disable-shared-library --enable-static-library --prefix="`pwd`/../$(BUILD_PATH)/botan-$(BOTAN_VERSION).tmp" ; fi cd botan-$(BOTAN_VERSION) && make install @@ -402,6 +402,7 @@ rnp: $(BUILD_PATH)/rnp-$(RNP_VERSION) $(BUILD_PATH)/rnp-$(RNP_VERSION): # prepare + rm -r -f $(BUILD_PATH)/rnp-* [ -d "rnp-$(RNP_VERSION)" ] || git clone https://github.com/rnpgp/rnp.git --depth=1 --branch v$(RNP_VERSION) --recurse-submodules --shallow-submodules "rnp-$(RNP_VERSION)" # build mkdir -p rnp-$(RNP_VERSION)/build From 01617da863761d6f2e833d516562ac37bc724dec Mon Sep 17 00:00:00 2001 From: defnax <9952056+defnax@users.noreply.github.com> Date: Mon, 30 Dec 2024 21:36:04 +0100 Subject: [PATCH 25/29] Fixed some frames to get compatible for system style * Fixed some frames to get compatible for system style * update macos package script --- build_scripts/OSX/makeOSXPackage.sh | 3 ++- plugins/FeedReader/gui/FeedReaderDialog.ui | 4 ++-- .../src/gui/FileTransfer/SharedFilesDialog.ui | 6 ++--- retroshare-gui/src/gui/FriendsDialog.ui | 8 +++---- retroshare-gui/src/gui/Identity/IdDialog.ui | 8 +++---- .../src/gui/common/GroupTreeWidget.ui | 4 ++-- .../src/gui/common/NewFriendList.ui | 4 ++-- .../src/gui/msgs/MessageComposer.ui | 22 +++++++++---------- 8 files changed, 30 insertions(+), 29 deletions(-) diff --git a/build_scripts/OSX/makeOSXPackage.sh b/build_scripts/OSX/makeOSXPackage.sh index 24808d487..8f9700ed0 100644 --- a/build_scripts/OSX/makeOSXPackage.sh +++ b/build_scripts/OSX/makeOSXPackage.sh @@ -2,7 +2,7 @@ APP="RetroShare" RSVERSION="0.6.7a" -QTVERSION="Qt-5.14.1" +QTVERSION="Qt-5.15.11" # Install the 7z to create dmg archives. #brew list p7zip || brew install p7zip @@ -21,6 +21,7 @@ rm -rf qrc /usr/libexec/PlistBuddy -c "Delete :CFBundleGetInfoString" retroshare.app/Contents/Info.plist /usr/libexec/PlistBuddy -c "Add :CFBundleVersion string $RSVERSION" retroshare.app/Contents/Info.plist /usr/libexec/PlistBuddy -c "Add :CFBundleShortVersionString string $RSVERSION" retroshare.app/Contents/Info.plist +/usr/libexec/PlistBuddy -c "Delete :NSRequiresAquaSystemAppearance" retroshare.app/Contents/Info.plist # This automatically creates retroshare.dmg diff --git a/plugins/FeedReader/gui/FeedReaderDialog.ui b/plugins/FeedReader/gui/FeedReaderDialog.ui index b6b004d69..440bb7736 100644 --- a/plugins/FeedReader/gui/FeedReaderDialog.ui +++ b/plugins/FeedReader/gui/FeedReaderDialog.ui @@ -57,10 +57,10 @@ - QFrame::Box + QFrame::StyledPanel - QFrame::Sunken + QFrame::Raised diff --git a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.ui b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.ui index cd79340dd..4c8f8c38b 100644 --- a/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.ui +++ b/retroshare-gui/src/gui/FileTransfer/SharedFilesDialog.ui @@ -23,10 +23,10 @@ - QFrame::Box + QFrame::StyledPanel - QFrame::Sunken + QFrame::Raised @@ -399,8 +399,8 @@ border-image: url(:/images/closepressed.png) - + diff --git a/retroshare-gui/src/gui/FriendsDialog.ui b/retroshare-gui/src/gui/FriendsDialog.ui index 02408e382..a8e8217fc 100644 --- a/retroshare-gui/src/gui/FriendsDialog.ui +++ b/retroshare-gui/src/gui/FriendsDialog.ui @@ -102,7 +102,7 @@ Qt::NoFocus - + :/icons/help_64.png:/icons/help_64.png @@ -132,10 +132,10 @@ - QFrame::Box + QFrame::StyledPanel - QFrame::Sunken + QFrame::Raised @@ -401,8 +401,8 @@ - + diff --git a/retroshare-gui/src/gui/Identity/IdDialog.ui b/retroshare-gui/src/gui/Identity/IdDialog.ui index 37bb33556..ee28522e3 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.ui +++ b/retroshare-gui/src/gui/Identity/IdDialog.ui @@ -154,10 +154,10 @@ - QFrame::Box + QFrame::StyledPanel - QFrame::Sunken + QFrame::Raised @@ -334,10 +334,10 @@ - QFrame::Box + QFrame::StyledPanel - QFrame::Sunken + QFrame::Raised Your Avatar diff --git a/retroshare-gui/src/gui/common/GroupTreeWidget.ui b/retroshare-gui/src/gui/common/GroupTreeWidget.ui index d3e0a14a5..029d71fb9 100644 --- a/retroshare-gui/src/gui/common/GroupTreeWidget.ui +++ b/retroshare-gui/src/gui/common/GroupTreeWidget.ui @@ -35,10 +35,10 @@ - QFrame::Box + QFrame::StyledPanel - QFrame::Sunken + QFrame::Raised diff --git a/retroshare-gui/src/gui/common/NewFriendList.ui b/retroshare-gui/src/gui/common/NewFriendList.ui index f41d88a8b..4bd4dfdc6 100644 --- a/retroshare-gui/src/gui/common/NewFriendList.ui +++ b/retroshare-gui/src/gui/common/NewFriendList.ui @@ -29,10 +29,10 @@ - QFrame::Box + QFrame::StyledPanel - QFrame::Sunken + QFrame::Raised diff --git a/retroshare-gui/src/gui/msgs/MessageComposer.ui b/retroshare-gui/src/gui/msgs/MessageComposer.ui index 9b5e8605c..a5ff266d4 100644 --- a/retroshare-gui/src/gui/msgs/MessageComposer.ui +++ b/retroshare-gui/src/gui/msgs/MessageComposer.ui @@ -349,10 +349,10 @@ - QFrame::Box + QFrame::StyledPanel - QFrame::Sunken + QFrame::Raised @@ -1400,6 +1400,11 @@ border-image: url(:/images/closepressed.png) + + RSComboBox + QComboBox +
gui/common/RSComboBox.h
+
FriendSelectionWidget QWidget @@ -1411,21 +1416,16 @@ border-image: url(:/images/closepressed.png) QComboBox
gui/gxs/GxsIdChooser.h
- - HashBox - QScrollArea -
gui/common/HashBox.h
- 1 -
MimeTextEdit QTextEdit
gui/common/MimeTextEdit.h
- RSComboBox - QComboBox -
gui/common/RSComboBox.h
+ HashBox + QScrollArea +
gui/common/HashBox.h
+ 1
From 2ca36f59574c3bb31bd7b096f7d435493afe325d Mon Sep 17 00:00:00 2001 From: David Bears Date: Thu, 2 Jan 2025 22:27:43 -0500 Subject: [PATCH 26/29] Fix port settings for manual I2P --- retroshare-gui/src/gui/settings/ServerPage.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/retroshare-gui/src/gui/settings/ServerPage.cpp b/retroshare-gui/src/gui/settings/ServerPage.cpp index adb1d655c..be2404bc8 100755 --- a/retroshare-gui/src/gui/settings/ServerPage.cpp +++ b/retroshare-gui/src/gui/settings/ServerPage.cpp @@ -228,6 +228,7 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags) connect(ui.hiddenpage_proxyPort_tor, SIGNAL(editingFinished()),this,SLOT(saveAddresses())); connect(ui.hiddenpage_proxyAddress_i2p, SIGNAL(editingFinished()),this,SLOT(saveAddresses())); connect(ui.hiddenpage_proxyPort_i2p, SIGNAL(editingFinished()),this,SLOT(saveAddresses())); + connect(ui.hiddenpage_localPort, SIGNAL(editingFinished()),this,SLOT(saveAddresses())); connect(ui.totalDownloadRate,SIGNAL(valueChanged(int)),this,SLOT(saveRates())); connect(ui.totalUploadRate, SIGNAL(valueChanged(int)),this,SLOT(saveRates())); @@ -1139,18 +1140,18 @@ void ServerPage::loadHiddenNode() ui.iconlabel_ext->hide(); ui.textlabel_ext->hide(); ui.extPortLabel->hide(); - + ui.ipAddressLabel->hide(); ui.cleanKnownIPs_PB->hide(); - + ui.ipAddressList->hide(); ui.allowIpDeterminationCB->hide(); ui.IPServersLV->hide(); - + ui.textlabel_hiddenMode->show(); ui.iconlabel_hiddenMode->show() ; ui.iconlabel_hiddenMode->setPixmap(FilesDefs::getPixmapFromQtResourcePath(":/images/ledon1.png")); - + // CHANGE OPTIONS ON whileBlocking(ui.discComboBox)->removeItem(3); whileBlocking(ui.discComboBox)->removeItem(2); @@ -1731,8 +1732,9 @@ void ServerPage::saveSam() new_proxyaddr = ui.hiddenpage_proxyAddress_i2p -> text().toStdString(); new_proxyport = ui.hiddenpage_proxyPort_i2p -> value(); - // SAMv3 has no proxy port, everything goes through the SAM port. - if ((new_proxyaddr != orig_proxyaddr) /* || (new_proxyport != orig_proxyport) */) { + // SAMv3 has no proxy port, everything goes through the SAM port. + // Still need to check the proxyport for manual i2p + if ((new_proxyaddr != orig_proxyaddr) || (new_proxyport != orig_proxyport)) { rsPeers->setProxyServer(RS_HIDDEN_TYPE_I2P, new_proxyaddr, new_proxyport); } } From 0759359e06de756a70ac9c963480d700a69d5a79 Mon Sep 17 00:00:00 2001 From: David Bears Date: Thu, 2 Jan 2025 22:38:46 -0500 Subject: [PATCH 27/29] Fix JSON API token removal --- .../src/gui/settings/JsonApiPage.cc | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/retroshare-gui/src/gui/settings/JsonApiPage.cc b/retroshare-gui/src/gui/settings/JsonApiPage.cc index 2b7f25d80..ace092e0c 100644 --- a/retroshare-gui/src/gui/settings/JsonApiPage.cc +++ b/retroshare-gui/src/gui/settings/JsonApiPage.cc @@ -232,23 +232,23 @@ void JsonApiPage::addTokenClicked() whileBlocking(ui.tokensListView)->setModel(new QStringListModel(newTk)); } -void JsonApiPage::removeTokenClicked() -{ - QString token(ui.tokenLineEdit->text()); - rsJsonApi->revokeAuthToken(token.toStdString()); - - QStringList newTk; - - for(const auto& it : rsJsonApi->getAuthorizedTokens()) - newTk.push_back( - QString::fromStdString(it.first) + ":" + - QString::fromStdString(it.second) ); - - whileBlocking(ui.tokensListView)->setModel(new QStringListModel(Settings->getJsonApiAuthTokens()) ); -} - +void JsonApiPage::removeTokenClicked() +{ + QString token(ui.tokenLineEdit->text()); + std::string tokenStr = token.toStdString(); + rsJsonApi->revokeAuthToken(tokenStr.substr(0, tokenStr.find_first_of(":"))); + + QStringList newTk; + + for(const auto& it : rsJsonApi->getAuthorizedTokens()) + newTk.push_back( + QString::fromStdString(it.first) + ":" + + QString::fromStdString(it.second) ); + + whileBlocking(ui.tokensListView)->setModel(new QStringListModel(Settings->getJsonApiAuthTokens()) ); +} + void JsonApiPage::tokenClicked(const QModelIndex& index) { ui.tokenLineEdit->setText(ui.tokensListView->model()->data(index).toString()); } - From 99053597a909e3fc43faf4d143dba611025ddb33 Mon Sep 17 00:00:00 2001 From: David Bears Date: Fri, 3 Jan 2025 15:03:31 -0500 Subject: [PATCH 28/29] allow voting on own identities --- retroshare-gui/src/gui/Identity/IdDialog.cpp | 134 +++++++++---------- 1 file changed, 65 insertions(+), 69 deletions(-) diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 5afac35d3..032acaa2d 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -50,7 +50,7 @@ #include "util/rsdebug.h" #include "retroshare/rsgxsflags.h" -#include "retroshare/rsmsgs.h" +#include "retroshare/rsmsgs.h" #include "retroshare/rspeers.h" #include "retroshare/rsservicecontrol.h" @@ -167,7 +167,7 @@ IdDialog::IdDialog(QWidget *parent) // This is used to grab the broadcast of changes from p3GxsCircles, which is discarded by the current dialog, since it expects data for p3Identity only. //mCirclesBroadcastBase = new RsGxsUpdateBroadcastBase(rsGxsCircles, this); //connect(mCirclesBroadcastBase, SIGNAL(fillDisplay(bool)), this, SLOT(updateCirclesDisplay(bool))); - + ownItem = new QTreeWidgetItem(); ownItem->setText(RSID_COL_NICKNAME, tr("My own identities")); ownItem->setFont(RSID_COL_NICKNAME, ui->idTreeWidget->font()); @@ -253,7 +253,7 @@ IdDialog::IdDialog(QWidget *parent) connect(ui->filterLineEdit, SIGNAL(textChanged(QString)), this, SLOT(filterChanged(QString))); connect(ui->ownOpinion_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(modifyReputation())); - + connect(ui->inviteButton, SIGNAL(clicked()), this, SLOT(sendInvite())); connect(ui->editButton, SIGNAL(clicked()), this, SLOT(editIdentity())); @@ -269,7 +269,7 @@ IdDialog::IdDialog(QWidget *parent) /* Initialize splitter */ ui->mainSplitter->setStretchFactor(0, 0); ui->mainSplitter->setStretchFactor(1, 1); - + clearPerson(); /* Add filter types */ @@ -327,18 +327,18 @@ IdDialog::IdDialog(QWidget *parent) idTWHAction->setData(RSID_FILTER_BANNED); connect(idTWHAction, SIGNAL(toggled(bool)), this, SLOT(filterToggled(bool))); idTWHMenu->addAction(idTWHAction); - + QAction *CreateIDAction = new QAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/person.png"),tr("Create new Identity"), this); connect(CreateIDAction, SIGNAL(triggered()), this, SLOT(addIdentity())); - + QAction *CreateCircleAction = new QAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/circles.png"),tr("Create new circle"), this); connect(CreateCircleAction, SIGNAL(triggered()), this, SLOT(createExternalCircle())); - + QMenu *menu = new QMenu(); menu->addAction(CreateIDAction); menu->addAction(CreateCircleAction); ui->toolButton_New->setMenu(menu); - + /* Add filter actions */ QTreeWidgetItem *headerItem = ui->idTreeWidget->headerItem(); QString headerText = headerItem->text(RSID_COL_NICKNAME); @@ -361,14 +361,14 @@ IdDialog::IdDialog(QWidget *parent) ui->idTreeWidget->setColumnHidden(RSID_COL_IDTYPE, true); ui->idTreeWidget->setColumnHidden(RSID_COL_KEYID, true); - + /* Set initial column width */ int fontWidth = QFontMetricsF(ui->idTreeWidget->font()).width("W"); ui->idTreeWidget->setColumnWidth(RSID_COL_NICKNAME, 14 * fontWidth); ui->idTreeWidget->setColumnWidth(RSID_COL_KEYID, 20 * fontWidth); ui->idTreeWidget->setColumnWidth(RSID_COL_IDTYPE, 18 * fontWidth); ui->idTreeWidget->setColumnWidth(RSID_COL_VOTES, 2 * fontWidth); - + ui->idTreeWidget->setItemDelegate(new RSElidedItemDelegate()); ui->idTreeWidget->setItemDelegateForColumn( RSID_COL_NICKNAME, @@ -408,7 +408,7 @@ IdDialog::IdDialog(QWidget *parent) processSettings(true); // circles stuff - + //connect(ui->treeWidget_membership, SIGNAL(itemSelectionChanged()), this, SLOT(circle_selected())); connect(ui->treeWidget_membership, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(CircleListCustomPopupMenu(QPoint))); connect(ui->autoBanIdentities_CB, SIGNAL(toggled(bool)), this, SLOT(toggleAutoBanIdentities(bool))); @@ -516,10 +516,10 @@ void IdDialog::updateCirclesDisplay() { if(RsAutoUpdatePage::eventsLocked()) return ; - + if(!isVisible()) return ; - + #ifdef ID_DEBUG std::cerr << "!!Updating circles display!" << std::endl; #endif @@ -929,16 +929,16 @@ void IdDialog::loadCircles(const std::list& groupInfo) bool IdDialog::getItemCircleId(QTreeWidgetItem *item,RsGxsCircleId& id) { -#ifdef CIRCLE_MEMBERSHIP_CATEGORIES +#ifdef CIRCLE_MEMBERSHIP_CATEGORIES if ((!item) || (!item->parent())) return false; - + QString coltext = (item->parent()->parent())? (item->parent()->data(CIRCLEGROUP_CIRCLE_COL_GROUPID,Qt::UserRole).toString()) : (item->data(CIRCLEGROUP_CIRCLE_COL_GROUPID,Qt::UserRole).toString()); id = RsGxsCircleId( coltext.toStdString()) ; #else if(!item) return false; - + QString coltext = (item->parent())? (item->parent()->data(CIRCLEGROUP_CIRCLE_COL_GROUPID,Qt::UserRole).toString()) : (item->data(CIRCLEGROUP_CIRCLE_COL_GROUPID,Qt::UserRole).toString()); id = RsGxsCircleId( coltext.toStdString()) ; #endif @@ -967,19 +967,19 @@ void IdDialog::createExternalCircle() void IdDialog::showEditExistingCircle() { RsGxsCircleId id ; - + if(!getItemCircleId(ui->treeWidget_membership->currentItem(),id)) return ; - + uint32_t subscribe_flags = ui->treeWidget_membership->currentItem()->data(CIRCLEGROUP_CIRCLE_COL_GROUPFLAGS, Qt::UserRole).toUInt(); - + CreateCircleDialog dlg; - + dlg.editExistingId(RsGxsGroupId(id),true,!(subscribe_flags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN)) ; dlg.exec(); } -void IdDialog::grantCircleMembership() +void IdDialog::grantCircleMembership() { RsGxsCircleId circle_id ; @@ -996,7 +996,7 @@ void IdDialog::grantCircleMembership() }); } -void IdDialog::revokeCircleMembership() +void IdDialog::revokeCircleMembership() { RsGxsCircleId circle_id ; @@ -1025,22 +1025,22 @@ void IdDialog::revokeCircleMembership() }); } -void IdDialog::acceptCircleSubscription() +void IdDialog::acceptCircleSubscription() { RsGxsCircleId circle_id ; - + if(!getItemCircleId(ui->treeWidget_membership->currentItem(),circle_id)) return; RsGxsId own_id(qobject_cast(sender())->data().toString().toStdString()); - + rsGxsCircles->requestCircleMembership(own_id,circle_id) ; } -void IdDialog::cancelCircleSubscription() -{ +void IdDialog::cancelCircleSubscription() +{ RsGxsCircleId circle_id ; - + if(!getItemCircleId(ui->treeWidget_membership->currentItem(),circle_id)) return; @@ -1048,14 +1048,14 @@ void IdDialog::cancelCircleSubscription() rsGxsCircles->cancelCircleMembership(own_id,circle_id) ; } - + void IdDialog::CircleListCustomPopupMenu( QPoint ) { QMenu contextMnu( this ); RsGxsCircleId circle_id ; QTreeWidgetItem *item = ui->treeWidget_membership->currentItem(); - + if(!getItemCircleId(item,circle_id)) return ; @@ -1063,7 +1063,7 @@ void IdDialog::CircleListCustomPopupMenu( QPoint ) RsGxsId item_id(item->data(CIRCLEGROUP_CIRCLE_COL_GROUPID,Qt::UserRole).toString().toStdString()); bool is_circle ; bool am_I_circle_admin = false ; - + if(item_id == RsGxsId(circle_id)) // is it a circle? { uint32_t group_flags = item->data(CIRCLEGROUP_CIRCLE_COL_GROUPFLAGS, Qt::UserRole).toUInt(); @@ -1082,7 +1082,7 @@ void IdDialog::CircleListCustomPopupMenu( QPoint ) #ifdef CIRCLE_MEMBERSHIP_CATEGORIES } #endif - + #ifdef ID_DEBUG std::cerr << " Item is a circle item. Adding Edit/Details menu entry." << std::endl; #endif @@ -1090,7 +1090,7 @@ void IdDialog::CircleListCustomPopupMenu( QPoint ) contextMnu.addSeparator() ; } - else + else { current_gxs_id = RsGxsId(item_id); is_circle =false ; @@ -1105,9 +1105,9 @@ void IdDialog::CircleListCustomPopupMenu( QPoint ) std::cerr << " Item is a GxsId item. Requesting flags/group id from parent: " << circle_id << std::endl; #endif } - + RsGxsCircleDetails details ; - + if(!rsGxsCircles->getCircleDetails(circle_id,details))// grab real circle ID from parent. Make sure circle id is used correctly afterwards! { std::cerr << " (EE) cannot get circle info for ID " << circle_id << ". Not in cache?" << std::endl; @@ -1144,7 +1144,7 @@ void IdDialog::CircleListCustomPopupMenu( QPoint ) ids[REMOVE].push_back(*it) ; else ids[CANCEL].push_back(*it) ; - else + else if(subscribe_flags & GXS_EXTERNAL_CIRCLE_FLAGS_IN_ADMIN_LIST) ids[ACCEPT].push_back(*it) ; else @@ -1205,17 +1205,17 @@ void IdDialog::CircleListCustomPopupMenu( QPoint ) contextMnu.addMenu(menu) ; } } - + if(!is_circle && am_I_circle_admin) // I am circle admin. I can therefore revoke/accept membership { std::map::const_iterator it = details.mSubscriptionFlags.find(current_gxs_id) ; - + if(!current_gxs_id.isNull() && it != details.mSubscriptionFlags.end()) { contextMnu.addSeparator() ; if(it->second & GXS_EXTERNAL_CIRCLE_FLAGS_IN_ADMIN_LIST) - { + { QAction *action = new QAction(tr("Revoke this member"),this) ; action->setData(QString::fromStdString(current_gxs_id.toStdString())); QObject::connect(action,SIGNAL(triggered()), this, SLOT(revokeCircleMembership())); @@ -1260,7 +1260,7 @@ static QString getHumanReadableDuration(uint32_t seconds) return QString(QObject::tr("%1 hours ago")).arg(seconds/3600) ; else if(seconds < 2*24*3600) return QString(QObject::tr("%1 day ago")).arg(seconds/86400) ; - else + else return QString(QObject::tr("%1 days ago")).arg(seconds/86400) ; } @@ -1292,7 +1292,7 @@ void IdDialog::processSettings(bool load) // state of splitter Settings->setValue("splitter", ui->mainSplitter->saveState()); - + //save expanding Settings->setValue("ExpandAll", allItem->isExpanded()); Settings->setValue("ExpandContacts", contactsItem->isExpanded()); @@ -1486,13 +1486,13 @@ bool IdDialog::fillIdListItem(const RsGxsIdGroup& data, QTreeWidgetItem *&item, rsPeers->getGPGDetails(data.mPgpId, details); item->setText(RSID_COL_IDTYPE, QString::fromUtf8(details.name.c_str())); item->setToolTip(RSID_COL_IDTYPE,"Verified signature from node "+QString::fromStdString(data.mPgpId.toStdString())) ; - - + + QString tooltip = tr("Node name:")+" " + QString::fromUtf8(details.name.c_str()) + "\n"; tooltip += tr("Node Id :")+" " + QString::fromStdString(data.mPgpId.toStdString()) ; item->setToolTip(RSID_COL_KEYID,tooltip) ; } - else + else { QString txt = tr("[Unknown node]"); item->setText(RSID_COL_IDTYPE, txt); @@ -1547,13 +1547,13 @@ void IdDialog::loadIdentities(const std::map& ids_set RsPgpId ownPgpId = rsPeers->getGPGOwnId(); - // Update existing and remove not existing items + // Update existing and remove not existing items // Also remove items that do not have the correct parent QTreeWidgetItemIterator itemIterator(ui->idTreeWidget); QTreeWidgetItem *item = NULL; - while ((item = *itemIterator) != NULL) + while ((item = *itemIterator) != NULL) { ++itemIterator; auto it = ids_set.find(RsGxsGroupId(item->text(RSID_COL_KEYID).toStdString())) ; @@ -1601,11 +1601,11 @@ void IdDialog::loadIdentities(const std::map& ids_set } } - + /* count items */ int itemCount = contactsItem->childCount() + allItem->childCount() + ownItem->childCount(); ui->label_count->setText( "(" + QString::number( itemCount ) + ")" ); - + int contactsCount = contactsItem->childCount() ; int allCount = allItem->childCount() ; int ownCount = ownItem->childCount(); @@ -1743,7 +1743,7 @@ void IdDialog::loadIdentity(RsGxsIdGroup data) ui->lineEdit_GpgId->show() ; ui->label_GpgId->show() ; } - + if(data.mPgpKnown) { ui->lineEdit_GpgName->show() ; @@ -1783,7 +1783,6 @@ void IdDialog::loadIdentity(RsGxsIdGroup data) if (isOwnId) { - mStateHelper->setWidgetEnabled(ui->ownOpinion_CB, false); mStateHelper->setWidgetEnabled(ui->autoBanIdentities_CB, false); // ui->editIdentity->setEnabled(true); // ui->removeIdentity->setEnabled(true); @@ -1793,8 +1792,6 @@ void IdDialog::loadIdentity(RsGxsIdGroup data) } else { - // No Reputation yet! - mStateHelper->setWidgetEnabled(ui->ownOpinion_CB, true); mStateHelper->setWidgetEnabled(ui->autoBanIdentities_CB, true); // ui->editIdentity->setEnabled(false); // ui->removeIdentity->setEnabled(false); @@ -1838,7 +1835,7 @@ void IdDialog::loadIdentity(RsGxsIdGroup data) frep_string = tr("No votes from friends") ; ui->neighborNodesOpinion_TF->setText(frep_string) ; - + ui->label_positive->setText(QString::number(info.mFriendsPositiveVotes)); ui->label_negative->setText(QString::number(info.mFriendsNegativeVotes)); @@ -2040,7 +2037,7 @@ void IdDialog::modifyReputation() return; } - + void IdDialog::navigate(const RsGxsId& gxs_id) { #ifdef ID_DEBUG @@ -2266,29 +2263,29 @@ void IdDialog::IdListCustomPopupMenu( QPoint ) if(n_is_a_contact == 0) contextMenu->addAction(QIcon(), tr("Add to Contacts"), this, SLOT(addtoContacts())); - if (n_selected_items==1) - contextMenu->addAction(QIcon(""),tr("Copy identity to clipboard"),this,SLOT(copyRetroshareLink())) ; - if(n_is_not_a_contact == 0) contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/cancel.svg"), tr("Remove from Contacts"), this, SLOT(removefromContacts())); - contextMenu->addSeparator(); + } - if(n_positive_reputations == 0) // only unban when all items are banned - contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/thumbs-up.png"), tr("Set positive opinion"), this, SLOT(positivePerson())); + if (n_selected_items==1) + contextMenu->addAction(QIcon(""),tr("Copy identity to clipboard"),this,SLOT(copyRetroshareLink())) ; - if(n_neutral_reputations == 0) // only unban when all items are banned - contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/thumbs-neutral.png"), tr("Set neutral opinion"), this, SLOT(neutralPerson())); + contextMenu->addSeparator(); - if(n_negative_reputations == 0) - contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/thumbs-down.png"), tr("Set negative opinion"), this, SLOT(negativePerson())); - } + if(n_positive_reputations == 0) // only unban when all items are banned + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/thumbs-up.png"), tr("Set positive opinion"), this, SLOT(positivePerson())); + + if(n_neutral_reputations == 0) // only unban when all items are banned + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/thumbs-neutral.png"), tr("Set neutral opinion"), this, SLOT(neutralPerson())); + + if(n_negative_reputations == 0) + contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/png/thumbs-down.png"), tr("Set negative opinion"), this, SLOT(negativePerson())); if(one_item_owned_by_you && n_selected_items==1) { contextMenu->addSeparator(); - contextMenu->addAction(QIcon(""),tr("Copy identity to clipboard"),this,SLOT(copyRetroshareLink())) ; contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(IMAGE_EDIT),tr("Edit identity"),this,SLOT(editIdentity())) ; contextMenu->addAction(FilesDefs::getIconFromQtResourcePath(":/icons/cancel.svg"),tr("Delete identity"),this,SLOT(removeIdentity())) ; } @@ -2463,7 +2460,7 @@ void IdDialog::sendInvite() } RsGxsId id(ui->lineEdit_KeyId->text().toStdString()); - + //if ((QMessageBox::question(this, tr("Send invite?"),tr("Do you really want send a invite with your Certificate?"),QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes))== QMessageBox::Yes) { MessageComposer::sendInvite(id,false); @@ -2471,7 +2468,7 @@ void IdDialog::sendInvite() ui->info_Frame_Invite->show(); ui->inviteButton->setEnabled(false); } - + } @@ -2602,4 +2599,3 @@ void IdDialog::restoreExpandedCircleItems(const std::vector& expanded_root restoreTopLevel(mExternalOtherCircleItem,1); restoreTopLevel(mMyCircleItem,2); } - From 2c53c0231930311139605285262d6007957d9bd2 Mon Sep 17 00:00:00 2001 From: David Bears Date: Sat, 4 Jan 2025 13:48:00 -0500 Subject: [PATCH 29/29] omit newline after single link --- retroshare-gui/src/gui/RetroShareLink.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/retroshare-gui/src/gui/RetroShareLink.cpp b/retroshare-gui/src/gui/RetroShareLink.cpp index fd3571e7e..0001cd9bc 100644 --- a/retroshare-gui/src/gui/RetroShareLink.cpp +++ b/retroshare-gui/src/gui/RetroShareLink.cpp @@ -1920,7 +1920,9 @@ static void processList(const QStringList &list, const QString &textSingular, co void RSLinkClipboard::copyLinks(const QList& links) { QString res ; - for (int i = 0; i < links.size(); ++i) + if(links.size() == 1) + res += links[0].toString(); + else for(int i = 0; i < links.size(); ++i) res += links[i].toString() + "\n" ; QApplication::clipboard()->setText(res) ; @@ -2036,4 +2038,3 @@ void RSLinkClipboard::parseText(QString text, QList &links,Retro pos += rx.matchedLength(); } } -