diff --git a/libretroshare/src/gxs/rsgxsdataaccess.cc b/libretroshare/src/gxs/rsgxsdataaccess.cc index 7e6c89265..552c961dc 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.cc +++ b/libretroshare/src/gxs/rsgxsdataaccess.cc @@ -752,7 +752,7 @@ bool RsGxsDataAccess::getMsgSummary(MsgMetaReq* req) } -bool RsGxsDataAccess::getMsgList(const GxsMsgReq& msgIds, const RsTokReqOptionsV2& opts, GxsMsgReq msgIdsOut) +bool RsGxsDataAccess::getMsgList(const GxsMsgReq& msgIds, const RsTokReqOptionsV2& opts, GxsMsgReq& msgIdsOut) { GxsMsgMetaResult result; @@ -1009,8 +1009,6 @@ bool RsGxsDataAccess::getMsgRelatedInfo(MsgRelatedInfoReq *req) MsgMetaFilter filterMap; - RsStackMutex stack(mDataMutex); /***** LOCKED *****/ - // get meta data for all in group GxsMsgMetaResult result; GxsMsgReq msgIds; diff --git a/libretroshare/src/gxs/rsgxsdataaccess.h b/libretroshare/src/gxs/rsgxsdataaccess.h index 575fc3426..04911bf65 100644 --- a/libretroshare/src/gxs/rsgxsdataaccess.h +++ b/libretroshare/src/gxs/rsgxsdataaccess.h @@ -350,7 +350,7 @@ private: * @param opts the options used to parameterise the id filter * @param msgIdsOut the left overs ids after filter is applied to msgIds */ - bool getMsgList(const GxsMsgReq& msgIds, const RsTokReqOptionsV2& opts, GxsMsgReq msgIdsOut); + bool getMsgList(const GxsMsgReq& msgIds, const RsTokReqOptionsV2& opts, GxsMsgReq& msgIdsOut); private: diff --git a/libretroshare/src/tests/gxs/genexchangetester.cpp b/libretroshare/src/tests/gxs/genexchangetester.cpp index b63f1475b..88bbf39ae 100644 --- a/libretroshare/src/tests/gxs/genexchangetester.cpp +++ b/libretroshare/src/tests/gxs/genexchangetester.cpp @@ -725,6 +725,118 @@ bool GenExchangeTester::testMsgIdRetrieval() return true; } +bool GenExchangeTester::testMsgChildRetrieval() +{ + // start up + setUp(); + setUpGrps(); + + /********************/ + + + // create msgs + // then make all requests immediately then poll afterwards for each and run outbound test + // we want only latest for now + int nMsgs = (rand()%50)+2; // test a large number of msgs + std::vector msgs; + createMsgs(msgs, nMsgs); + RsTokReqOptionsV2 opts; + opts.mReqType = 4000; + uint32_t token; + + bool first = true; + RsGxsGrpMsgIdPair firstMsgId; + + // everyone is parent of first msg + + for(int i=0; i < nMsgs; i++) + { + RsDummyMsg* msg = msgs[i]; + + int j = rand()%5; + + + if(first){ + msg->meta.mParentId = ""; + msg->meta.mOrigMsgId = ""; + } + else + { + msg->meta.mParentId = firstMsgId.second; + msg->meta.mGroupId = firstMsgId.first; + msg->meta.mOrigMsgId = ""; + } + + mTestService->publishDummyMsg(token, msg); + pollForToken(token, opts); + RsGxsGrpMsgIdPair msgId; + mTestService->acknowledgeTokenMsg(token, msgId); + + // less than half have no parents + if(first){ + firstMsgId.second = msgId.second; + firstMsgId.first = msgId.first; + + } + + if(msgId.first.empty() || msgId.second.empty()) + { + breakDown(); + std::cerr << "serious error: Acknowledgement failed! " << std::endl; + return false; + } + + if(!first) + { + mMsgIdsOut[msgId.first].push_back(msgId.second); + first = false; + } + + } + + + opts.mReqType = GXS_REQUEST_TYPE_MSG_IDS; + opts.mOptions = RS_TOKREQOPT_MSG_PARENT | RS_TOKREQOPT_MSG_LATEST; + mTokenService->requestMsgRelatedInfo(token, 0, opts, firstMsgId); + + pollForToken(token, opts); + + GxsMsgIdResult::iterator mit = mMsgIdsOut.begin(); + for(; mit != mMsgIdsOut.end(); mit++) + { + std::vector msgIdsOut, msgIdsIn; + msgIdsOut = mit->second; + + std::vector::iterator vit_out = msgIdsOut.begin(), vit_in; + + for(; vit_out != msgIdsOut.end(); vit_out++) + { + bool found = false; + msgIdsIn = mMsgIdsIn[mit->first]; + vit_in = msgIdsIn.begin(); + + for(; vit_in != msgIdsIn.end(); vit_in++) + { + if(*vit_in == *vit_out) + found = true; + } + + if(!found){ + breakDown(); + return false; + } + + } + } + + /********************/ + + // complete + breakDown(); + + return true; +} + bool GenExchangeTester::testSpecificMsgMetaRetrieval() { @@ -874,12 +986,12 @@ bool GenExchangeTester::testMsgIdRetrieval_OptParents() } - GxsMsgReq req; + std::list req; // use empty grp ids request types, non specific msgs ids for(int i=0; i < mRandGrpIds.size(); i++) { - req[mRandGrpIds[i]] = std::vector(); + req.push_back(mRandGrpIds[i]); } opts.mReqType = GXS_REQUEST_TYPE_MSG_IDS; @@ -971,12 +1083,12 @@ bool GenExchangeTester::testMsgIdRetrieval_OptOrigMsgId() } - GxsMsgReq req; + std::list req; // use empty grp ids request types, non specific msgs ids for(int i=0; i < mRandGrpIds.size(); i++) { - req[mRandGrpIds[i]] = std::vector(); + req.push_back(mRandGrpIds[i]); } opts.mReqType = GXS_REQUEST_TYPE_MSG_IDS; @@ -1181,10 +1293,10 @@ bool GenExchangeTester::testMsgIdRetrieval_OptLatest() // use empty grp ids request types, non specific msgs ids - GxsMsgReq req; + std::list req; for(int i=0; i < mRandGrpIds.size(); i++) { - req[mRandGrpIds[i]] = std::vector(); + req.push_back(mRandGrpIds[i]); } opts.mReqType = GXS_REQUEST_TYPE_MSG_IDS; diff --git a/libretroshare/src/tests/gxs/genexchangetester.h b/libretroshare/src/tests/gxs/genexchangetester.h index 67be18ed3..83f6150e6 100644 --- a/libretroshare/src/tests/gxs/genexchangetester.h +++ b/libretroshare/src/tests/gxs/genexchangetester.h @@ -32,6 +32,9 @@ public: bool testMsgIdRetrieval_OptLatest(); bool testSpecificMsgMetaRetrieval(); + bool testMsgChildRetrieval(); + + bool testGrpSubmissionRetrieval(); bool testSpecificGrpRetrieval(); bool testGrpIdRetrieval(); diff --git a/libretroshare/src/tests/gxs/nxs_tests.pro b/libretroshare/src/tests/gxs/nxs_tests.pro index 8ceaba0f0..977c90e2c 100644 --- a/libretroshare/src/tests/gxs/nxs_tests.pro +++ b/libretroshare/src/tests/gxs/nxs_tests.pro @@ -75,6 +75,73 @@ linux-g++-64 { OBJECTS_DIR = temp/linux-g++-64/obj } +#################################### Windows ##################################### + +win32 { + + DEFINES *= WINDOWS_SYS \ + WIN32 \ + STATICLIB \ + MINGW + # Switch on extra warnings + QMAKE_CFLAGS += -Wextra + QMAKE_CXXFLAGS += -Wextra + + # Switch off optimization for release version + QMAKE_CXXFLAGS_RELEASE -= -O2 + QMAKE_CXXFLAGS_RELEASE += -O0 + QMAKE_CFLAGS_RELEASE -= -O2 + QMAKE_CFLAGS_RELEASE += -O0 + + # Switch on optimization for debug version + #QMAKE_CXXFLAGS_DEBUG += -O2 + #QMAKE_CFLAGS_DEBUG += -O2 + +# PRE_TARGETDEPS += ../../libretroshare/src/lib/libretroshare.a + PRE_TARGETDEPS += ../../../../libretroshare/libretroshare-build-desktop/lib/libretroshare.a + + LIBS += ../../../../libretroshare/libretroshare-build-desktop/lib/libretroshare.a + LIBS += C:\Development\Rs\v0.5-gxs-b1\openpgpsdk\openpgpsdk-build-desktop\lib\libops.a + LIBS += C:\Development\Libraries\sqlite\sqlite-autoconf-3070900\lib\libsqlite3.a + LIBS += -L"../../../../../lib" + LIBS += -lssl -lcrypto -lgpgme -lpthreadGC2d -lminiupnpc -lz -lbz2 +# added after bitdht +# LIBS += -lws2_32 + LIBS += -luuid -lole32 -liphlpapi -lcrypt32-cygwin -lgdi32 + LIBS += -lole32 -lwinmm + + # export symbols for the plugins + #LIBS += -Wl,--export-all-symbols,--out-implib,lib/libretroshare-gui.a + + GPG_ERROR_DIR = ../../../../libgpg-error-1.7 + GPGME_DIR = ../../../../gpgme-1.1.8 + GPG_ERROR_DIR = ../../../../lib/libgpg-error-1.7 + GPGME_DIR = ../../../../lib/gpgme-1.1.8 + INCLUDEPATH += . $${GPGME_DIR}/src $${GPG_ERROR_DIR}/src + + SQLITE_DIR = ../../../../../../Libraries/sqlite/sqlite-autoconf-3070900 + INCLUDEPATH += . \ + $${SQLITE_DIR} + + + + +} + +bitdht { + LIBS += C:\Development\Rs\v0.5-gxs-b1\libbitdht\libbitdht-build-desktop\lib\libbitdht.a + PRE_TARGETDEPS *= C:\Development\Rs\v0.5-gxs-b1\libbitdht\libbitdht-build-desktop\lib\libbitdht.a + + # Chris version. + #LIBS += ../../libbitdht/libbitdht-build-desktop/lib/libbitdht.a + #PRE_TARGETDEPS *= ../../libbitdht/libbitdht-build-desktop/lib/libbitdht.a +} + +win32 { +# must be added after bitdht + LIBS += -lws2_32 +} + version_detail_bash_script { DEFINES += ADD_LIBRETROSHARE_VERSION_INFO QMAKE_EXTRA_TARGETS += write_version_detail @@ -120,4 +187,4 @@ gen_exchange_target { } -INCLUDEPATH += ../../ \ No newline at end of file +INCLUDEPATH += ../../ diff --git a/libretroshare/src/tests/gxs/rsgenexchange_test.cc b/libretroshare/src/tests/gxs/rsgenexchange_test.cc index 2a1bc4537..c60c2eb96 100644 --- a/libretroshare/src/tests/gxs/rsgenexchange_test.cc +++ b/libretroshare/src/tests/gxs/rsgenexchange_test.cc @@ -14,13 +14,14 @@ int main() { GenExchangeTester tester; - CHECK(tester.testMsgSubmissionRetrieval()); REPORT("testMsgSubmissionRetrieval()"); +// CHECK(tester.testMsgSubmissionRetrieval()); REPORT("testMsgSubmissionRetrieval()"); // CHECK(tester.testSpecificMsgMetaRetrieval()); REPORT("testSpecificMsgMetaRetrieval()"); -// CHECK(tester.testMsgIdRetrieval()); REPORT("tester.testMsgIdRetrieval()"); -// CHECK(tester.testMsgIdRetrieval_OptParents()); REPORT("tester.testRelatedMsgIdRetrieval_Parents()"); +// CHECK(tester.testMsgIdRetrieval()); REPORT("tester.testMsgIdRetrieval()"); + //CHECK(tester.testMsgIdRetrieval_OptParents()); REPORT("tester.testRelatedMsgIdRetrieval_Parents()"); // CHECK(tester.testMsgIdRetrieval_OptOrigMsgId()); REPORT("tester.testRelatedMsgIdRetrieval_OrigMsgId()"); // CHECK(tester.testMsgIdRetrieval_OptLatest()); REPORT("tester.testRelatedMsgIdRetrieval_Latest()"); -// CHECK(tester.testMsgMetaModRequest()); REPORT("tester.testMsgMetaModRequest()"); + //CHECK(tester.testMsgMetaModRequest()); REPORT("tester.testMsgMetaModRequest()"); + CHECK(tester.testMsgChildRetrieval()); REPORT("tester.testMsgMetaModRequest()"); // CHECK(tester.testGrpSubmissionRetrieval()); REPORT("tester.testGrpSubmissionRetrieval()"); // CHECK(tester.testGrpMetaRetrieval()); REPORT("tester.testGrpMetaRetrieval()"); diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.ui b/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.ui index a0a27b3d1..78b7f8415 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.ui +++ b/retroshare-gui/src/gui/PhotoShare/PhotoCommentItem.ui @@ -1,21 +1,76 @@ + - - - PhotoCommentItem 0 0 - 400 - 300 + 484 + 110 Form + + + + + QFrame#expandFrame{border: 2px solid #D3D3D3; +background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1, +stop:0 #FFFFFF, stop:1 #F2F2F2);; +border-radius: 10px;} + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + QWidget#msgWidget{border: 2px solid #238; +border-radius: 10px;} + + + + 5 + + + + + + 0 + 0 + + + + + PreferAntialias + + + + true + + + true + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + - +