diff --git a/build_scripts/Windows-msys2/build/build.bat b/build_scripts/Windows-msys2/build/build.bat index 97d6e5853..d15e5babc 100644 --- a/build_scripts/Windows-msys2/build/build.bat +++ b/build_scripts/Windows-msys2/build/build.bat @@ -18,7 +18,7 @@ if errorlevel 2 exit /B 2 if errorlevel 1 goto error_env :: 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%-libmicrohttpd mingw-w64-%RsMSYS2Architecture%-xapian-core" +%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%-libmicrohttpd mingw-w64-%RsMSYS2Architecture%-xapian-core mingw-w64-%RsMSYS2Architecture%-cmake mingw-w64-%RsMSYS2Architecture%-rapidjson" :: Plugins if "%ParamPlugins%"=="1" %EnvMSYS2Cmd% "pacman --noconfirm --needed -S mingw-w64-%RsMSYS2Architecture%-speex mingw-w64-%RsMSYS2Architecture%-speexdsp mingw-w64-%RsMSYS2Architecture%-curl mingw-w64-%RsMSYS2Architecture%-libxslt mingw-w64-%RsMSYS2Architecture%-opencv mingw-w64-%RsMSYS2Architecture%-ffmpeg" diff --git a/build_scripts/Windows-msys2/build/pack.bat b/build_scripts/Windows-msys2/build/pack.bat index 5be0ac56e..e8c9761bc 100644 --- a/build_scripts/Windows-msys2/build/pack.bat +++ b/build_scripts/Windows-msys2/build/pack.bat @@ -99,6 +99,7 @@ copy nul "%RsDeployPath%\portable" %Quite% echo copy binaries copy "%RsBuildPath%\retroshare-gui\src\%RsBuildConfig%\RetroShare*.exe" "%RsDeployPath%" %Quite% copy "%RsBuildPath%\retroshare-nogui\src\%RsBuildConfig%\retroshare*-nogui.exe" "%RsDeployPath%" %Quite% +copy "%RsBuildPath%\retroshare-service\src\%RsBuildConfig%\retroshare*-service.exe" "%RsDeployPath%" %Quite% echo copy extensions for /D %%D in ("%RsBuildPath%\plugins\*") do ( @@ -127,6 +128,9 @@ if exist "%QtSharePath%\plugins\styles\qwindowsvistastyle.dll" ( copy "%QtSharePath%\plugins\imageformats\*.dll" "%RsDeployPath%\imageformats" %Quite% del /Q "%RsDeployPath%\imageformats\*d?.dll" %Quite% +for %%D in ("%RsDeployPath%\imageformats\*.dll") do ( + call :copy_dependencies "%%D" "%RsDeployPath%" +) echo copy qss xcopy /S "%SourcePath%\retroshare-gui\src\qss" "%RsDeployPath%\qss" %Quite% diff --git a/libretroshare/src/pqi/p3peermgr.cc b/libretroshare/src/pqi/p3peermgr.cc index b7902e181..e871e4ddd 100644 --- a/libretroshare/src/pqi/p3peermgr.cc +++ b/libretroshare/src/pqi/p3peermgr.cc @@ -1074,26 +1074,22 @@ bool p3PeerMgrIMPL::addFriend(const RsPeerId& input_id, const RsPgpId& input_gpg bool p3PeerMgrIMPL::addSslOnlyFriend( const RsPeerId& sslId, const RsPgpId& pgp_id, const RsPeerDetails& dt ) { - if(sslId.isNull()) + constexpr auto fname = __PRETTY_FUNCTION__; + const auto failure = [&](const std::string& err) { - RsErr() << __PRETTY_FUNCTION__ << " Cannot add a null " - << "ID as SSL-only friend " << std::endl; + RsErr() << fname << " " << err << std::endl; return false; - } + }; + + if(sslId.isNull()) + return failure("Cannot add a null ID as SSL-only friend"); if(pgp_id.isNull()) - { - RsErr() << __PRETTY_FUNCTION__ << " Cannot add as SSL-only friend a " - << "peer with null PGP" << std::endl; - return false; - } + return failure( " Cannot add as SSL-only friend a peer with null PGP"); if(sslId == getOwnId()) - { - RsErr() << __PRETTY_FUNCTION__ << " Cannot add yourself as SSL-only " - << "friend (id=" << sslId << ")" << std::endl; - return false; - } + return failure( "Cannot add yourself as SSL-only friend id:" + + sslId.toStdString() ); bool alreadySslFriend = false; peerState pstate; @@ -1116,13 +1112,10 @@ bool p3PeerMgrIMPL::addSslOnlyFriend( * PGP id we already know, to avoid nasty tricks with malevolently forged * short invites.*/ if(alreadySslFriend && pstate.gpg_id != pgp_id) - { - RsErr() << __PRETTY_FUNCTION__ << " Cannot SSL-only friend for " - << "a pre-existing friend with mismatching PGP-id " - << "known: " << pstate.gpg_id << " new: " << pgp_id - << std::endl; - return false; - } + return failure( "Cannot SSL-only friend for a pre-existing friend with " + "mismatching PGP-id known: " + + pstate.gpg_id.toStdString() + " new: " + + pgp_id.toStdString() ); /* It is very important to be expecially carefull setting * pstate.skip_pgp_signature_validation to true because this effectively @@ -1137,8 +1130,11 @@ bool p3PeerMgrIMPL::addSslOnlyFriend( * connection closed. * Instead if pstate.skip_pgp_signature_validation would have been * superficially set to true the PGP signature verification would have been - * skipped and the attacker connection would be accepted. */ - if(!AuthGPG::getAuthGPG()->isPgpPubKeyAvailable(pgp_id)) + * skipped and the attacker connection would be accepted. + * If the PGP key is available add it as full friend. */ + if(AuthGPG::getAuthGPG()->isPgpPubKeyAvailable(pgp_id)) + AuthGPG::getAuthGPG()->AllowConnection(pgp_id, true); + else pstate.skip_pgp_signature_validation = true; pstate.gpg_id = pgp_id; diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index d5b6b799b..5d8c45804 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -2019,7 +2019,9 @@ QString IdDialog::createUsageString(const RsIdentityUsage& u) const case RsIdentityUsage::CHAT_LOBBY_MSG_VALIDATION: // Chat lobby msgs are signed, so each time one comes, or a chat lobby event comes, a signature verificaiton happens. { ChatId id = ChatId(ChatLobbyId(u.mAdditionalId)); - RetroShareLink l = RetroShareLink::createChatRoom(id, QString::fromStdString(id.toStdString())); + ChatLobbyInfo linfo ; + rsMsgs->getChatLobbyInfo(ChatLobbyId(u.mAdditionalId),linfo); + RetroShareLink l = RetroShareLink::createChatRoom(id, QString::fromUtf8(linfo.lobby_name.c_str())); return tr("Message in chat room %1").arg(l.toHtml()) ; } case RsIdentityUsage::GLOBAL_ROUTER_SIGNATURE_CHECK: // Global router message validation diff --git a/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp b/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp index 57fc7031b..f9b8b1dbc 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsCommentDialog.cpp @@ -19,6 +19,7 @@ *******************************************************************************/ #include "gui/gxs/GxsCommentDialog.h" +#include "gui/gxs/GxsCommentTreeWidget.h" #include "ui_GxsCommentDialog.h" #include @@ -50,6 +51,7 @@ GxsCommentDialog::GxsCommentDialog(QWidget *parent, RsTokenService *token_servic connect(ui->idChooser, SIGNAL(currentIndexChanged( int )), this, SLOT(voterSelectionChanged( int ))); connect(ui->idChooser, SIGNAL(idsLoaded()), this, SLOT(idChooserReady())); + connect(ui->commentButton, SIGNAL(clicked()), ui->treeWidget, SLOT(makeComment())); connect(ui->sortBox, SIGNAL(currentIndexChanged(int)), this, SLOT(sortComments(int))); // default sort method "HOT". diff --git a/retroshare-gui/src/gui/gxs/GxsCommentDialog.ui b/retroshare-gui/src/gui/gxs/GxsCommentDialog.ui index 6bf6b1112..c349c6eb7 100644 --- a/retroshare-gui/src/gui/gxs/GxsCommentDialog.ui +++ b/retroshare-gui/src/gui/gxs/GxsCommentDialog.ui @@ -40,6 +40,32 @@ + + + + + 0 + 0 + + + + Comment + + + + :/icons/png/comment.png:/icons/png/comment.png + + + + 20 + 20 + + + + Qt::ToolButtonTextBesideIcon + + + diff --git a/retroshare-gui/src/rshare.cpp b/retroshare-gui/src/rshare.cpp index 872273613..3898a899a 100644 --- a/retroshare-gui/src/rshare.cpp +++ b/retroshare-gui/src/rshare.cpp @@ -241,6 +241,11 @@ Rshare::Rshare(QStringList args, int &argc, char **argv, const QString &dir) localServer= new QLocalServer(); QObject::connect(localServer, SIGNAL(newConnection()), this, SLOT(slotConnectionEstablished())); updateLocalServer(); + // clear out any old arguments (race condition?) + QSharedMemory newArgs; + newArgs.setKey(QString(TARGET) + "_newArgs"); + if(newArgs.attach(QSharedMemory::ReadWrite)) + newArgs.detach(); } } @@ -325,20 +330,27 @@ Rshare::~Rshare() */ void Rshare::slotConnectionEstablished() { - QLocalSocket *socket = localServer->nextPendingConnection(); - socket->close(); - delete socket; - QSharedMemory newArgs; newArgs.setKey(QString(TARGET) + "_newArgs"); + QLocalSocket *socket = localServer->nextPendingConnection(); + if (!newArgs.attach()) { - std::cerr << "(EE) Rshare::slotConnectionEstablished() Unable to attach to shared memory segment." - << newArgs.errorString().toStdString() << std::endl; + /* this is not an error. It just means we were notified to check + newArgs, but none had been set yet. + TODO: implement separate ping/take messages + std::cerr << "(EE) Rshare::slotConnectionEstablished() Unable to attach to shared memory segment." + << newArgs.errorString().toStdString() << std::endl; + */ + socket->close(); + delete socket; return; } + socket->close(); + delete socket; + QBuffer buffer; QDataStream in(&buffer); QStringList args;