mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-01 20:52:05 -04:00
fixed merged with upstream/master
This commit is contained in:
commit
c9b30f5a72
88 changed files with 3867 additions and 977 deletions
|
@ -31,6 +31,7 @@
|
|||
#include "gui/RetroShareLink.h"
|
||||
#include "util/HandleRichText.h"
|
||||
#include "util/misc.h"
|
||||
#include "util/rsdir.h"
|
||||
|
||||
#include <retroshare/rsfiles.h>
|
||||
|
||||
|
@ -449,11 +450,10 @@ void CreateGxsChannelMsg::addAttachment(const std::string &path)
|
|||
}
|
||||
|
||||
FileInfo fInfo;
|
||||
std::string filename;
|
||||
std::string filename = RsDirUtil::getTopDir(path);
|
||||
uint64_t size = 0;
|
||||
RsFileHash hash ;
|
||||
|
||||
rsGxsChannels->ExtraFileHash(path, filename);
|
||||
rsGxsChannels->ExtraFileHash(path);
|
||||
|
||||
// Only path and filename are valid.
|
||||
// Destroyed when fileFrame (this subfileitem) is destroyed
|
||||
|
|
|
@ -112,11 +112,11 @@ void GxsForumsFillThread::run()
|
|||
service->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, grpIds);
|
||||
|
||||
/* wait for the answer */
|
||||
uint32_t requestStatus = RsTokenService::GXS_REQUEST_V2_STATUS_PENDING;
|
||||
uint32_t requestStatus = RsTokenService::PENDING;
|
||||
while (!wasStopped()) {
|
||||
requestStatus = service->requestStatus(token);
|
||||
if (requestStatus == RsTokenService::GXS_REQUEST_V2_STATUS_FAILED ||
|
||||
requestStatus == RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE) {
|
||||
if (requestStatus == RsTokenService::FAILED ||
|
||||
requestStatus == RsTokenService::COMPLETE) {
|
||||
break;
|
||||
}
|
||||
msleep(100);
|
||||
|
@ -132,7 +132,7 @@ void GxsForumsFillThread::run()
|
|||
return;
|
||||
}
|
||||
|
||||
if (requestStatus == RsTokenService::GXS_REQUEST_V2_STATUS_FAILED) {
|
||||
if (requestStatus == RsTokenService::FAILED) {
|
||||
//#TODO
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -191,7 +191,6 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
|
|||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
|
||||
connect(ui.discComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(saveAddresses()));
|
||||
connect(ui.netModeComboBox,SIGNAL(currentIndexChanged(int)),this,SLOT(saveAddresses()));
|
||||
connect(ui.localAddress, SIGNAL(textChanged(QString)),this,SLOT(saveAddresses()));
|
||||
|
@ -231,6 +230,10 @@ ServerPage::ServerPage(QWidget * parent, Qt::WindowFlags flags)
|
|||
|
||||
QObject::connect(ui.enableCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateRelayMode()));
|
||||
QObject::connect(ui.serverCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateRelayMode()));
|
||||
|
||||
// when the network menu is opened and the hidden service tab is already selected updateOutProxyIndicator() won't be called and thus resulting in wrong proxy indicators.
|
||||
if (ui.tabWidget->currentIndex() == TAB_HIDDEN_SERVICE)
|
||||
updateOutProxyIndicator();
|
||||
}
|
||||
|
||||
void ServerPage::saveAndTestInProxy()
|
||||
|
|
|
@ -22,6 +22,9 @@ resource_api::ApiServerMHD* WebuiPage::apiServerMHD = 0;
|
|||
resource_api::ApiServerLocal* WebuiPage::apiServerLocal = 0;
|
||||
#endif
|
||||
resource_api::RsControlModule* WebuiPage::controlModule = 0;
|
||||
#ifdef RS_JSONAPI
|
||||
JsonApiServer* WebuiPage::jsonApiServer = nullptr;
|
||||
#endif
|
||||
|
||||
WebuiPage::WebuiPage(QWidget */*parent*/, Qt::WindowFlags /*flags*/)
|
||||
{
|
||||
|
@ -105,6 +108,11 @@ QString WebuiPage::helpText() const
|
|||
// TODO: LIBRESAPI_LOCAL_SERVER Move in appropriate place
|
||||
#ifdef LIBRESAPI_LOCAL_SERVER
|
||||
apiServerLocal = new resource_api::ApiServerLocal(apiServer, resource_api::ApiServerLocal::serverPath());
|
||||
#endif
|
||||
#ifdef RS_JSONAPI
|
||||
// Use same port of libresapi + 2
|
||||
jsonApiServer = new JsonApiServer(Settings->getWebinterfacePort() + 2);
|
||||
jsonApiServer->start("WebuiPage::jsonApiServer");
|
||||
#endif
|
||||
return ok;
|
||||
}
|
||||
|
@ -126,6 +134,10 @@ QString WebuiPage::helpText() const
|
|||
delete controlModule;
|
||||
controlModule = 0;
|
||||
}
|
||||
#ifdef RS_JSONAPI
|
||||
delete jsonApiServer;
|
||||
jsonApiServer = nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*static*/ void WebuiPage::showWebui()
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
#include <retroshare-gui/configpage.h>
|
||||
#include "ui_WebuiPage.h"
|
||||
|
||||
#ifdef RS_JSONAPI
|
||||
# include "jsonapi/jsonapi.h"
|
||||
#endif
|
||||
|
||||
namespace resource_api{
|
||||
class ApiServer;
|
||||
class ApiServerMHD;
|
||||
|
@ -55,4 +59,7 @@ private:
|
|||
static resource_api::ApiServerLocal* apiServerLocal;
|
||||
#endif
|
||||
static resource_api::RsControlModule* controlModule;
|
||||
#ifdef RS_JSONAPI
|
||||
static JsonApiServer* jsonApiServer;
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -164,8 +164,8 @@ bool TokenQueue::checkForRequest(uint32_t token)
|
|||
{
|
||||
/* check token */
|
||||
uint32_t status = mService->requestStatus(token);
|
||||
return ( (RsTokenService::GXS_REQUEST_V2_STATUS_FAILED == status) ||
|
||||
(RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE == status) );
|
||||
return ( (RsTokenService::FAILED == status) ||
|
||||
(RsTokenService::COMPLETE == status) );
|
||||
}
|
||||
|
||||
bool TokenQueue::activeRequestExist(const uint32_t& userType) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue