mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge branch 'master' of https://github.com/RetroShare/RetroShare
This commit is contained in:
commit
cc4be39025
@ -7,7 +7,6 @@ SUBDIRS += \
|
||||
libbitdht \
|
||||
libretroshare \
|
||||
libresapi \
|
||||
pegmarkdown \
|
||||
retroshare_gui \
|
||||
retroshare_nogui \
|
||||
plugins
|
||||
@ -22,10 +21,8 @@ libretroshare.depends = openpgpsdk libbitdht
|
||||
libresapi.file = libresapi/src/libresapi.pro
|
||||
libresapi.depends = libretroshare
|
||||
|
||||
pegmarkdown.file = supportlibs/pegmarkdown/pegmarkdown.pro
|
||||
|
||||
retroshare_gui.file = retroshare-gui/src/retroshare-gui.pro
|
||||
retroshare_gui.depends = libretroshare libresapi pegmarkdown
|
||||
retroshare_gui.depends = libretroshare libresapi
|
||||
retroshare_gui.target = retroshare-gui
|
||||
|
||||
retroshare_nogui.file = retroshare-nogui/src/retroshare-nogui.pro
|
||||
@ -35,3 +32,9 @@ retroshare_nogui.target = retroshare-nogui
|
||||
plugins.file = plugins/plugins.pro
|
||||
plugins.depends = retroshare_gui
|
||||
plugins.target = plugins
|
||||
|
||||
wikipoos {
|
||||
SUBDIRS += pegmarkdown
|
||||
pegmarkdown.file = supportlibs/pegmarkdown/pegmarkdown.pro
|
||||
retroshare_gui.depends += pegmarkdown
|
||||
}
|
||||
|
@ -1,5 +1,20 @@
|
||||
retroshare06 (0.6.0-1.XXXXXX~YYYYYY) YYYYYY; urgency=low
|
||||
|
||||
|
||||
6bc6e22 ( ) Merge pull request #92 from AsamK/fix_travis_voip
|
||||
f2994b7 (VOIP ) Old libav versions used constant without AV_ prefix
|
||||
efc057e (VOIP ) Fix build with libavcodec < 55
|
||||
7385dd1 ( ) Merge pull request #91 from AsamK/fix_opensuse_compile
|
||||
fd19349 ( ) Merge pull request #90 from PhenomRetroShare/Fix_Travis_CI_Compilation
|
||||
976f53b (VOIP ) Remove -lavformat from VOIP, it's unused
|
||||
484edc3 (VOIP ) Fix build for openSUSE
|
||||
22816f0 (VOIP ) Remove unnecessary includes from VideoProcessor
|
||||
6b94248 (VOIP ) Fix Travis CI compilation by adding libavutil-dev package.
|
||||
c892f8a (VOIP ) Merge pull request #85 from PhenomRetroShare/Fix_VOIP_CompilWithRecentLibavutil
|
||||
0a84398 (VOIP ) Fix VOIP compilation with recent libavutil-dev package. /usr/include/libavutil/common.h error 'UINT64C' was n
|
||||
6614536 (VOIP ) Added register of codecs to VOIP.
|
||||
738dada (VOIP ) Fixed Windows compile of VOIP.
|
||||
9bbdefa (Packaging ) Added "QMAKE_LFLAGS += -Wl,--start-group" to pluigns for Windows compile.
|
||||
b1b2de6 (Packaging ) Fixed Windows compile. - Set name for prl file in libretroshare.pro - Use "QMAKE_LFLAGS += -Wl,--start-group"
|
||||
a276986 ( ) Merge pull request #60 from PhenomRetroShare/Fix_AllowChatTextFormatOption
|
||||
88a6931 (GUI ) Allow Chat Text Format Option working.
|
||||
0b5b20d ( ) Merge pull request #59 from AsamK/qmake_improvements
|
||||
|
@ -152,6 +152,11 @@ RsDataService::RsDataService(const std::string &serviceDir, const std::string &d
|
||||
mColMsg_MetaData = addColumn(mMsgColumns, KEY_NXS_META);
|
||||
mColMsg_MsgId = addColumn(mMsgColumns, KEY_MSG_ID);
|
||||
|
||||
// for retrieving msg data with meta
|
||||
mMsgColumnsWithMeta = mMsgColumns;
|
||||
mColMsg_WithMetaOffset = mMsgColumnsWithMeta.size();
|
||||
mMsgColumnsWithMeta.insert(mMsgColumnsWithMeta.end(), mMsgMetaColumns.begin(), mMsgMetaColumns.end());
|
||||
|
||||
// for retrieving grp meta data
|
||||
mColGrpMeta_GrpId = addColumn(mGrpMetaColumns, KEY_GRP_ID);
|
||||
mColGrpMeta_TimeStamp = addColumn(mGrpMetaColumns, KEY_TIME_STAMP);
|
||||
@ -184,6 +189,11 @@ RsDataService::RsDataService(const std::string &serviceDir, const std::string &d
|
||||
mColGrp_NxsData = addColumn(mGrpColumns, KEY_NXS_DATA);
|
||||
mColGrp_MetaData = addColumn(mGrpColumns, KEY_NXS_META);
|
||||
|
||||
// for retrieving grp data with meta
|
||||
mGrpColumnsWithMeta = mGrpColumns;
|
||||
mColGrp_WithMetaOffset = mGrpColumnsWithMeta.size();
|
||||
mGrpColumnsWithMeta.insert(mGrpColumnsWithMeta.end(), mGrpMetaColumns.begin(), mGrpMetaColumns.end());
|
||||
|
||||
// Group id columns
|
||||
mColGrpId_GrpId = addColumn(mGrpIdColumn, KEY_GRP_ID);
|
||||
|
||||
@ -474,7 +484,7 @@ bool RsDataService::finishReleaseUpdate(int release, bool result)
|
||||
return result;
|
||||
}
|
||||
|
||||
RsGxsGrpMetaData* RsDataService::locked_getGrpMeta(RetroCursor &c)
|
||||
RsGxsGrpMetaData* RsDataService::locked_getGrpMeta(RetroCursor &c, int colOffset)
|
||||
{
|
||||
#ifdef RS_DATA_SERVICE_DEBUG
|
||||
std::cerr << "RsDataService::locked_getGrpMeta()";
|
||||
@ -492,27 +502,27 @@ RsGxsGrpMetaData* RsDataService::locked_getGrpMeta(RetroCursor &c)
|
||||
|
||||
// grpId
|
||||
std::string tempId;
|
||||
c.getString(mColGrpMeta_GrpId, tempId);
|
||||
c.getString(mColGrpMeta_GrpId + colOffset, tempId);
|
||||
grpMeta->mGroupId = RsGxsGroupId(tempId);
|
||||
c.getString(mColGrpMeta_NxsIdentity, tempId);
|
||||
c.getString(mColGrpMeta_NxsIdentity + colOffset, tempId);
|
||||
grpMeta->mAuthorId = RsGxsId(tempId);
|
||||
|
||||
c.getString(mColGrpMeta_Name, grpMeta->mGroupName);
|
||||
c.getString(mColGrpMeta_OrigGrpId, tempId);
|
||||
c.getString(mColGrpMeta_Name + colOffset, grpMeta->mGroupName);
|
||||
c.getString(mColGrpMeta_OrigGrpId + colOffset, tempId);
|
||||
grpMeta->mOrigGrpId = RsGxsGroupId(tempId);
|
||||
c.getString(mColGrpMeta_ServString, grpMeta->mServiceString);
|
||||
c.getString(mColGrpMeta_ServString + colOffset, grpMeta->mServiceString);
|
||||
std::string temp;
|
||||
c.getString(mColGrpMeta_NxsHash, temp);
|
||||
c.getString(mColGrpMeta_NxsHash + colOffset, temp);
|
||||
grpMeta->mHash = RsFileHash(temp);
|
||||
grpMeta->mReputationCutOff = c.getInt32(mColGrpMeta_RepCutoff);
|
||||
grpMeta->mSignFlags = c.getInt32(mColGrpMeta_SignFlags);
|
||||
grpMeta->mReputationCutOff = c.getInt32(mColGrpMeta_RepCutoff + colOffset);
|
||||
grpMeta->mSignFlags = c.getInt32(mColGrpMeta_SignFlags + colOffset);
|
||||
|
||||
grpMeta->mPublishTs = c.getInt32(mColGrpMeta_TimeStamp);
|
||||
grpMeta->mGroupFlags = c.getInt32(mColGrpMeta_NxsFlags);
|
||||
grpMeta->mGrpSize = c.getInt32(mColGrpMeta_NxsDataLen);
|
||||
grpMeta->mPublishTs = c.getInt32(mColGrpMeta_TimeStamp + colOffset);
|
||||
grpMeta->mGroupFlags = c.getInt32(mColGrpMeta_NxsFlags + colOffset);
|
||||
grpMeta->mGrpSize = c.getInt32(mColGrpMeta_NxsDataLen + colOffset);
|
||||
|
||||
offset = 0; data = NULL; data_len = 0;
|
||||
data = (char*)c.getData(mColGrpMeta_KeySet, data_len);
|
||||
data = (char*)c.getData(mColGrpMeta_KeySet + colOffset, data_len);
|
||||
|
||||
if(data)
|
||||
ok &= grpMeta->keys.GetTlv(data, data_len, &offset);
|
||||
@ -520,22 +530,22 @@ RsGxsGrpMetaData* RsDataService::locked_getGrpMeta(RetroCursor &c)
|
||||
grpMeta->keys.TlvClear() ;
|
||||
|
||||
// local meta
|
||||
grpMeta->mSubscribeFlags = c.getInt32(mColGrpMeta_SubscrFlag);
|
||||
grpMeta->mPop = c.getInt32(mColGrpMeta_Pop);
|
||||
grpMeta->mVisibleMsgCount = c.getInt32(mColGrpMeta_MsgCount);
|
||||
grpMeta->mLastPost = c.getInt32(mColGrpMeta_LastPost);
|
||||
grpMeta->mGroupStatus = c.getInt32(mColGrpMeta_Status);
|
||||
grpMeta->mSubscribeFlags = c.getInt32(mColGrpMeta_SubscrFlag + colOffset);
|
||||
grpMeta->mPop = c.getInt32(mColGrpMeta_Pop + colOffset);
|
||||
grpMeta->mVisibleMsgCount = c.getInt32(mColGrpMeta_MsgCount + colOffset);
|
||||
grpMeta->mLastPost = c.getInt32(mColGrpMeta_LastPost + colOffset);
|
||||
grpMeta->mGroupStatus = c.getInt32(mColGrpMeta_Status + colOffset);
|
||||
|
||||
c.getString(mColGrpMeta_CircleId, tempId);
|
||||
c.getString(mColGrpMeta_CircleId + colOffset, tempId);
|
||||
grpMeta->mCircleId = RsGxsCircleId(tempId);
|
||||
grpMeta->mCircleType = c.getInt32(mColGrpMeta_CircleType);
|
||||
c.getString(mColGrpMeta_InternCircle, tempId);
|
||||
grpMeta->mCircleType = c.getInt32(mColGrpMeta_CircleType + colOffset);
|
||||
c.getString(mColGrpMeta_InternCircle + colOffset, tempId);
|
||||
grpMeta->mInternalCircle = RsGxsCircleId(tempId);
|
||||
|
||||
std::string s ; c.getString(mColGrpMeta_Originator, s) ;
|
||||
std::string s ; c.getString(mColGrpMeta_Originator + colOffset, s) ;
|
||||
grpMeta->mOriginator = RsPeerId(s);
|
||||
grpMeta->mAuthenFlags = c.getInt32(mColGrpMeta_AuthenFlags);
|
||||
grpMeta->mRecvTS = c.getInt32(mColGrpMeta_RecvTs);
|
||||
grpMeta->mAuthenFlags = c.getInt32(mColGrpMeta_AuthenFlags + colOffset);
|
||||
grpMeta->mRecvTS = c.getInt32(mColGrpMeta_RecvTs + colOffset);
|
||||
|
||||
|
||||
c.getString(mColGrpMeta_ParentGrpId, tempId);
|
||||
@ -591,7 +601,7 @@ RsNxsGrp* RsDataService::locked_getGroup(RetroCursor &c)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
RsGxsMsgMetaData* RsDataService::locked_getMsgMeta(RetroCursor &c)
|
||||
RsGxsMsgMetaData* RsDataService::locked_getMsgMeta(RetroCursor &c, int colOffset)
|
||||
{
|
||||
|
||||
RsGxsMsgMetaData* msgMeta = new RsGxsMsgMetaData();
|
||||
@ -602,44 +612,44 @@ RsGxsMsgMetaData* RsDataService::locked_getMsgMeta(RetroCursor &c)
|
||||
char* data = NULL;
|
||||
|
||||
std::string gId;
|
||||
c.getString(mColMsgMeta_GrpId, gId);
|
||||
c.getString(mColMsgMeta_GrpId + colOffset, gId);
|
||||
msgMeta->mGroupId = RsGxsGroupId(gId);
|
||||
std::string temp;
|
||||
c.getString(mColMsgMeta_MsgId, temp);
|
||||
c.getString(mColMsgMeta_MsgId + colOffset, temp);
|
||||
msgMeta->mMsgId = RsGxsMessageId(temp);
|
||||
// without these, a msg is meaningless
|
||||
ok &= (!msgMeta->mGroupId.isNull()) && (!msgMeta->mMsgId.isNull());
|
||||
|
||||
c.getString(mColMsgMeta_OrigMsgId, temp);
|
||||
c.getString(mColMsgMeta_OrigMsgId + colOffset, temp);
|
||||
msgMeta->mOrigMsgId = RsGxsMessageId(temp);
|
||||
c.getString(mColMsgMeta_NxsIdentity, temp);
|
||||
c.getString(mColMsgMeta_NxsIdentity + colOffset, temp);
|
||||
msgMeta->mAuthorId = RsGxsId(temp);
|
||||
c.getString(mColMsgMeta_Name, msgMeta->mMsgName);
|
||||
c.getString(mColMsgMeta_NxsServString, msgMeta->mServiceString);
|
||||
c.getString(mColMsgMeta_Name + colOffset, msgMeta->mMsgName);
|
||||
c.getString(mColMsgMeta_NxsServString + colOffset, msgMeta->mServiceString);
|
||||
|
||||
c.getString(mColMsgMeta_NxsHash, temp);
|
||||
c.getString(mColMsgMeta_NxsHash + colOffset, temp);
|
||||
msgMeta->mHash = RsFileHash(temp);
|
||||
msgMeta->recvTS = c.getInt32(mColMsgMeta_RecvTs);
|
||||
msgMeta->recvTS = c.getInt32(mColMsgMeta_RecvTs + colOffset);
|
||||
|
||||
offset = 0;
|
||||
data = (char*)c.getData(mColMsgMeta_SignSet, data_len);
|
||||
data = (char*)c.getData(mColMsgMeta_SignSet + colOffset, data_len);
|
||||
msgMeta->signSet.GetTlv(data, data_len, &offset);
|
||||
msgMeta->mMsgSize = c.getInt32(mColMsgMeta_NxsDataLen);
|
||||
msgMeta->mMsgSize = c.getInt32(mColMsgMeta_NxsDataLen + colOffset);
|
||||
|
||||
msgMeta->mMsgFlags = c.getInt32(mColMsgMeta_NxsFlags);
|
||||
msgMeta->mPublishTs = c.getInt32(mColMsgMeta_TimeStamp);
|
||||
msgMeta->mMsgFlags = c.getInt32(mColMsgMeta_NxsFlags + colOffset);
|
||||
msgMeta->mPublishTs = c.getInt32(mColMsgMeta_TimeStamp + colOffset);
|
||||
|
||||
offset = 0; data_len = 0;
|
||||
|
||||
// thread and parent id
|
||||
c.getString(mColMsgMeta_MsgThreadId, temp);
|
||||
c.getString(mColMsgMeta_MsgThreadId + colOffset, temp);
|
||||
msgMeta->mThreadId = RsGxsMessageId(temp);
|
||||
c.getString(mColMsgMeta_MsgParentId, temp);
|
||||
c.getString(mColMsgMeta_MsgParentId + colOffset, temp);
|
||||
msgMeta->mParentId = RsGxsMessageId(temp);
|
||||
|
||||
// local meta
|
||||
msgMeta->mMsgStatus = c.getInt32(mColMsgMeta_MsgStatus);
|
||||
msgMeta->mChildTs = c.getInt32(mColMsgMeta_ChildTs);
|
||||
msgMeta->mMsgStatus = c.getInt32(mColMsgMeta_MsgStatus + colOffset);
|
||||
msgMeta->mChildTs = c.getInt32(mColMsgMeta_ChildTs + colOffset);
|
||||
|
||||
if(ok)
|
||||
return msgMeta;
|
||||
@ -1020,13 +1030,13 @@ int RsDataService::retrieveNxsGrps(std::map<RsGxsGroupId, RsNxsGrp *> &grp, bool
|
||||
if(grp.empty()){
|
||||
|
||||
RsStackMutex stack(mDbMutex);
|
||||
RetroCursor* c = mDb->sqlQuery(GRP_TABLE_NAME, mGrpColumns, "", "");
|
||||
RetroCursor* c = mDb->sqlQuery(GRP_TABLE_NAME, withMeta ? mGrpColumnsWithMeta : mGrpColumns, "", "");
|
||||
|
||||
if(c)
|
||||
{
|
||||
std::vector<RsNxsGrp*> grps;
|
||||
|
||||
locked_retrieveGroups(c, grps);
|
||||
locked_retrieveGroups(c, grps, withMeta ? mColGrp_WithMetaOffset : 0);
|
||||
std::vector<RsNxsGrp*>::iterator vit = grps.begin();
|
||||
|
||||
#ifdef RS_DATA_SERVICE_DEBUG_TIME
|
||||
@ -1051,12 +1061,12 @@ int RsDataService::retrieveNxsGrps(std::map<RsGxsGroupId, RsNxsGrp *> &grp, bool
|
||||
for(; mit != grp.end(); ++mit)
|
||||
{
|
||||
const RsGxsGroupId& grpId = mit->first;
|
||||
RetroCursor* c = mDb->sqlQuery(GRP_TABLE_NAME, mGrpColumns, "grpId='" + grpId.toStdString() + "'", "");
|
||||
RetroCursor* c = mDb->sqlQuery(GRP_TABLE_NAME, withMeta ? mGrpColumnsWithMeta : mGrpColumns, "grpId='" + grpId.toStdString() + "'", "");
|
||||
|
||||
if(c)
|
||||
{
|
||||
std::vector<RsNxsGrp*> grps;
|
||||
locked_retrieveGroups(c, grps);
|
||||
locked_retrieveGroups(c, grps, withMeta ? mColGrp_WithMetaOffset : 0);
|
||||
|
||||
if(!grps.empty())
|
||||
{
|
||||
@ -1085,38 +1095,10 @@ int RsDataService::retrieveNxsGrps(std::map<RsGxsGroupId, RsNxsGrp *> &grp, bool
|
||||
std::cerr << "RsDataService::retrieveNxsGrps() " << mDbName << ", Requests: " << requestedGroups << ", Results: " << resultCount << ", Time: " << timer.duration() << std::endl;
|
||||
#endif
|
||||
|
||||
if(withMeta && !grp.empty())
|
||||
{
|
||||
std::map<RsGxsGroupId, RsGxsGrpMetaData*> metaMap;
|
||||
std::map<RsGxsGroupId, RsNxsGrp *>::iterator mit = grp.begin();
|
||||
for(; mit != grp.end(); ++mit)
|
||||
metaMap.insert(std::make_pair(mit->first, (RsGxsGrpMetaData*)(NULL)));
|
||||
|
||||
retrieveGxsGrpMetaData(metaMap);
|
||||
|
||||
mit = grp.begin();
|
||||
for(; mit != grp.end(); ++mit)
|
||||
{
|
||||
RsNxsGrp* grpPtr = grp[mit->first];
|
||||
grpPtr->metaData = metaMap[mit->first];
|
||||
|
||||
#ifdef RS_DATA_SERVICE_DEBUG
|
||||
std::cerr << "RsDataService::retrieveNxsGrps() GrpId: " << mit->first.toStdString();
|
||||
std::cerr << " CircleType: " << (uint32_t) grpPtr->metaData->mCircleType;
|
||||
std::cerr << " CircleId: " << grpPtr->metaData->mCircleId.toStdString();
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef RS_DATA_SERVICE_DEBUG_TIME
|
||||
std::cerr << "RsDataService::retrieveNxsGrps() " << mDbName << ", Time with meta: " << timer.duration() << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void RsDataService::locked_retrieveGroups(RetroCursor* c, std::vector<RsNxsGrp*>& grps){
|
||||
void RsDataService::locked_retrieveGroups(RetroCursor* c, std::vector<RsNxsGrp*>& grps, int metaOffset){
|
||||
|
||||
if(c){
|
||||
bool valid = c->moveToFirst();
|
||||
@ -1127,6 +1109,9 @@ void RsDataService::locked_retrieveGroups(RetroCursor* c, std::vector<RsNxsGrp*>
|
||||
// only add the latest grp info
|
||||
if(g)
|
||||
{
|
||||
if (metaOffset) {
|
||||
g->metaData = locked_getGrpMeta(*c, metaOffset);
|
||||
}
|
||||
grps.push_back(g);
|
||||
}
|
||||
valid = c->moveToNext();
|
||||
@ -1143,8 +1128,6 @@ int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, b
|
||||
|
||||
GxsMsgReq::const_iterator mit = reqIds.begin();
|
||||
|
||||
GxsMsgReq metaReqIds;// collects metaReqIds if needed
|
||||
|
||||
for(; mit != reqIds.end(); ++mit)
|
||||
{
|
||||
|
||||
@ -1158,11 +1141,11 @@ int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, b
|
||||
|
||||
RsStackMutex stack(mDbMutex);
|
||||
|
||||
RetroCursor* c = mDb->sqlQuery(MSG_TABLE_NAME, mMsgColumns, KEY_GRP_ID+ "='" + grpId.toStdString() + "'", "");
|
||||
RetroCursor* c = mDb->sqlQuery(MSG_TABLE_NAME, withMeta ? mMsgColumnsWithMeta : mMsgColumns, KEY_GRP_ID+ "='" + grpId.toStdString() + "'", "");
|
||||
|
||||
if(c)
|
||||
{
|
||||
locked_retrieveMessages(c, msgSet);
|
||||
locked_retrieveMessages(c, msgSet, withMeta ? mColMsg_WithMetaOffset : 0);
|
||||
|
||||
#ifdef RS_DATA_SERVICE_DEBUG_TIME
|
||||
resultCount += msgSet.size();
|
||||
@ -1180,12 +1163,12 @@ int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, b
|
||||
|
||||
RsStackMutex stack(mDbMutex);
|
||||
|
||||
RetroCursor* c = mDb->sqlQuery(MSG_TABLE_NAME, mMsgColumns, KEY_GRP_ID+ "='" + grpId.toStdString()
|
||||
RetroCursor* c = mDb->sqlQuery(MSG_TABLE_NAME, withMeta ? mMsgColumnsWithMeta : mMsgColumns, KEY_GRP_ID+ "='" + grpId.toStdString()
|
||||
+ "' AND " + KEY_MSG_ID + "='" + msgId.toStdString() + "'", "");
|
||||
|
||||
if(c)
|
||||
{
|
||||
locked_retrieveMessages(c, msgSet);
|
||||
locked_retrieveMessages(c, msgSet, withMeta ? mColMsg_WithMetaOffset : 0);
|
||||
|
||||
#ifdef RS_DATA_SERVICE_DEBUG_TIME
|
||||
resultCount += c->getResultCount();
|
||||
@ -1198,18 +1181,6 @@ int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, b
|
||||
|
||||
msg[grpId] = msgSet;
|
||||
|
||||
if(withMeta)
|
||||
{
|
||||
std::vector<RsGxsMessageId> msgIds;
|
||||
|
||||
std::vector<RsNxsMsg*>::iterator lit = msgSet.begin(),
|
||||
lit_end = msgSet.end();
|
||||
|
||||
for(; lit != lit_end; ++lit)
|
||||
msgIds.push_back( (*lit)->msgId );
|
||||
|
||||
metaReqIds[grpId] = msgIds;
|
||||
}
|
||||
msgSet.clear();
|
||||
}
|
||||
|
||||
@ -1217,73 +1188,19 @@ int RsDataService::retrieveNxsMsgs(const GxsMsgReq &reqIds, GxsMsgResult &msg, b
|
||||
std::cerr << "RsDataService::retrieveNxsMsgs() " << mDbName << ", Requests: " << reqIds.size() << ", Results: " << resultCount << ", Time: " << timer.duration() << std::endl;
|
||||
#endif
|
||||
|
||||
// tres expensive !?
|
||||
if(withMeta)
|
||||
{
|
||||
|
||||
GxsMsgMetaResult metaResult;
|
||||
|
||||
// request with meta ids so there is no chance of
|
||||
// a mem leak being left over
|
||||
retrieveGxsMsgMetaData(metaReqIds, metaResult);
|
||||
|
||||
GxsMsgResult::iterator mit2 = msg.begin(), mit2_end = msg.end();
|
||||
|
||||
for(; mit2 != mit2_end; ++mit2)
|
||||
{
|
||||
const RsGxsGroupId& grpId = mit2->first;
|
||||
std::vector<RsNxsMsg*>& msgV = msg[grpId];
|
||||
std::vector<RsNxsMsg*>::iterator lit = msgV.begin(),
|
||||
lit_end = msgV.end();
|
||||
|
||||
// as retrieval only attempts to retrieve what was found this elimiates chance
|
||||
// of a memory fault as all are assigned
|
||||
for(; lit != lit_end; ++lit)
|
||||
{
|
||||
std::vector<RsGxsMsgMetaData*>& msgMetaV = metaResult[grpId];
|
||||
std::vector<RsGxsMsgMetaData*>::iterator meta_lit = msgMetaV.begin();
|
||||
RsNxsMsg* msgPtr = *lit;
|
||||
for(; meta_lit != msgMetaV.end(); )
|
||||
{
|
||||
RsGxsMsgMetaData* meta = *meta_lit;
|
||||
if(meta->mMsgId == msgPtr->msgId)
|
||||
{
|
||||
msgPtr->metaData = meta;
|
||||
meta_lit = msgMetaV.erase(meta_lit);
|
||||
}else{
|
||||
++meta_lit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<RsGxsMsgMetaData*>& msgMetaV = metaResult[grpId];
|
||||
std::vector<RsGxsMsgMetaData*>::iterator meta_lit;
|
||||
|
||||
// clean up just in case, should not go in here
|
||||
for(meta_lit = msgMetaV.begin(); meta_lit !=
|
||||
msgMetaV.end(); )
|
||||
{
|
||||
RsGxsMsgMetaData* meta = *meta_lit;
|
||||
delete meta;
|
||||
meta_lit = msgMetaV.erase(meta_lit);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef RS_DATA_SERVICE_DEBUG_TIME
|
||||
std::cerr << "RsDataService::retrieveNxsMsgs() " << mDbName << ", Time with meta: " << timer.duration() << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void RsDataService::locked_retrieveMessages(RetroCursor *c, std::vector<RsNxsMsg *> &msgs)
|
||||
void RsDataService::locked_retrieveMessages(RetroCursor *c, std::vector<RsNxsMsg *> &msgs, int metaOffset)
|
||||
{
|
||||
bool valid = c->moveToFirst();
|
||||
while(valid){
|
||||
RsNxsMsg* m = locked_getMessage(*c);
|
||||
|
||||
if(m){
|
||||
if (metaOffset) {
|
||||
m->metaData = locked_getMsgMeta(*c, metaOffset);
|
||||
}
|
||||
msgs.push_back(m);
|
||||
}
|
||||
|
||||
@ -1361,7 +1278,7 @@ void RsDataService::locked_retrieveMsgMeta(RetroCursor *c, std::vector<RsGxsMsgM
|
||||
{
|
||||
bool valid = c->moveToFirst();
|
||||
while(valid){
|
||||
RsGxsMsgMetaData* m = locked_getMsgMeta(*c);
|
||||
RsGxsMsgMetaData* m = locked_getMsgMeta(*c, 0);
|
||||
|
||||
if(m != NULL)
|
||||
msgMeta.push_back(m);
|
||||
@ -1402,7 +1319,7 @@ int RsDataService::retrieveGxsGrpMetaData(std::map<RsGxsGroupId, RsGxsGrpMetaDat
|
||||
|
||||
while(valid)
|
||||
{
|
||||
RsGxsGrpMetaData* g = locked_getGrpMeta(*c);
|
||||
RsGxsGrpMetaData* g = locked_getGrpMeta(*c, 0);
|
||||
if(g)
|
||||
{
|
||||
grp[g->mGroupId] = g;
|
||||
@ -1431,7 +1348,7 @@ int RsDataService::retrieveGxsGrpMetaData(std::map<RsGxsGroupId, RsGxsGrpMetaDat
|
||||
|
||||
while(valid)
|
||||
{
|
||||
RsGxsGrpMetaData* g = locked_getGrpMeta(*c);
|
||||
RsGxsGrpMetaData* g = locked_getGrpMeta(*c, 0);
|
||||
|
||||
if(g)
|
||||
{
|
||||
|
@ -181,14 +181,15 @@ private:
|
||||
* @param c cursor to result set
|
||||
* @param msgs messages retrieved from cursor are stored here
|
||||
*/
|
||||
void locked_retrieveMessages(RetroCursor* c, std::vector<RsNxsMsg*>& msgs);
|
||||
void locked_retrieveMessages(RetroCursor* c, std::vector<RsNxsMsg*>& msgs, int metaOffset);
|
||||
|
||||
/*!
|
||||
* Retrieves all the grp results from a cursor
|
||||
* @param c cursor to result set
|
||||
* @param grps groups retrieved from cursor are stored here
|
||||
* @param withMeta this initialise the metaData member of the nxsgroups retrieved
|
||||
*/
|
||||
void locked_retrieveGroups(RetroCursor* c, std::vector<RsNxsGrp*>& grps);
|
||||
void locked_retrieveGroups(RetroCursor* c, std::vector<RsNxsGrp*>& grps, int metaOffset);
|
||||
|
||||
/*!
|
||||
* Retrieves all the msg meta results from a cursor
|
||||
@ -201,13 +202,13 @@ private:
|
||||
* extracts a msg meta item from a cursor at its
|
||||
* current position
|
||||
*/
|
||||
RsGxsMsgMetaData* locked_getMsgMeta(RetroCursor& c);
|
||||
RsGxsMsgMetaData* locked_getMsgMeta(RetroCursor& c, int colOffset);
|
||||
|
||||
/*!
|
||||
* extracts a grp meta item from a cursor at its
|
||||
* current position
|
||||
*/
|
||||
RsGxsGrpMetaData* locked_getGrpMeta(RetroCursor& c);
|
||||
RsGxsGrpMetaData* locked_getGrpMeta(RetroCursor& c, int colOffset);
|
||||
|
||||
/*!
|
||||
* extracts a msg item from a cursor at its
|
||||
@ -257,10 +258,12 @@ private:
|
||||
|
||||
std::list<std::string> mMsgColumns;
|
||||
std::list<std::string> mMsgMetaColumns;
|
||||
std::list<std::string> mMsgColumnsWithMeta;
|
||||
std::list<std::string> mMsgIdColumn;
|
||||
|
||||
std::list<std::string> mGrpColumns;
|
||||
std::list<std::string> mGrpMetaColumns;
|
||||
std::list<std::string> mGrpColumnsWithMeta;
|
||||
std::list<std::string> mGrpIdColumn;
|
||||
|
||||
// Message meta column
|
||||
@ -287,6 +290,9 @@ private:
|
||||
int mColMsg_MetaData;
|
||||
int mColMsg_MsgId;
|
||||
|
||||
// Message columns with meta
|
||||
int mColMsg_WithMetaOffset;
|
||||
|
||||
// Group meta columns
|
||||
int mColGrpMeta_GrpId;
|
||||
int mColGrpMeta_TimeStamp;
|
||||
@ -319,6 +325,9 @@ private:
|
||||
int mColGrp_NxsData;
|
||||
int mColGrp_MetaData;
|
||||
|
||||
// Group columns with meta
|
||||
int mColGrp_WithMetaOffset;
|
||||
|
||||
// Group id columns
|
||||
int mColGrpId_GrpId;
|
||||
|
||||
|
@ -7,11 +7,6 @@ CONFIG -= qt
|
||||
TARGET = retroshare
|
||||
TARGET_PRL = libretroshare
|
||||
|
||||
|
||||
#GXS Stuff.
|
||||
# This should be disabled for releases until further notice.
|
||||
CONFIG += gxs
|
||||
|
||||
#CONFIG += dsdv
|
||||
|
||||
profiling {
|
||||
@ -268,6 +263,8 @@ win32 {
|
||||
|
||||
CONFIG += upnp_miniupnpc
|
||||
|
||||
LIBS += -lsqlcipher
|
||||
|
||||
LIBS_DIR = $$PWD/../../../libs
|
||||
OPENPGPSDK_DIR = $$PWD/../../openpgpsdk/src
|
||||
|
||||
@ -464,8 +461,8 @@ HEADERS += serialiser/itempriorities.h \
|
||||
serialiser/rsheartbeatitems.h \
|
||||
serialiser/rsrttitems.h \
|
||||
serialiser/rsgxsrecognitems.h \
|
||||
serialiser/rsgxsupdateitems.h \
|
||||
serialiser/rsserviceinfoitems.h \
|
||||
serialiser/rsgxsupdateitems.h \
|
||||
serialiser/rsserviceinfoitems.h \
|
||||
|
||||
HEADERS += services/p3msgservice.h \
|
||||
services/p3service.h \
|
||||
@ -614,8 +611,8 @@ SOURCES += serialiser/rsbaseserial.cc \
|
||||
serialiser/rsheartbeatitems.cc \
|
||||
serialiser/rsrttitems.cc \
|
||||
serialiser/rsgxsrecognitems.cc \
|
||||
serialiser/rsgxsupdateitems.cc \
|
||||
serialiser/rsserviceinfoitems.cc \
|
||||
serialiser/rsgxsupdateitems.cc \
|
||||
serialiser/rsserviceinfoitems.cc \
|
||||
|
||||
SOURCES += services/p3msgservice.cc \
|
||||
services/p3service.cc \
|
||||
@ -696,95 +693,94 @@ SOURCES += zeroconf/p3zcnatassist.cc \
|
||||
|
||||
# new gxs cache system
|
||||
# this should be disabled for releases until further notice.
|
||||
gxs {
|
||||
DEFINES *= RS_ENABLE_GXS
|
||||
DEFINES *= SQLITE_HAS_CODEC
|
||||
DEFINES *= GXS_ENABLE_SYNC_MSGS
|
||||
DEFINES *= SQLITE_HAS_CODEC
|
||||
DEFINES *= GXS_ENABLE_SYNC_MSGS
|
||||
|
||||
HEADERS += serialiser/rsnxsitems.h \
|
||||
gxs/rsgds.h \
|
||||
gxs/rsgxs.h \
|
||||
gxs/rsdataservice.h \
|
||||
gxs/rsgxsnetservice.h \
|
||||
retroshare/rsgxsflags.h \
|
||||
retroshare/rsgxsifacetypes.h \
|
||||
gxs/rsgenexchange.h \
|
||||
gxs/rsnxsobserver.h \
|
||||
gxs/rsgxsdata.h \
|
||||
retroshare/rstokenservice.h \
|
||||
gxs/rsgxsdataaccess.h \
|
||||
retroshare/rsgxsservice.h \
|
||||
serialiser/rsgxsitems.h \
|
||||
util/retrodb.h \
|
||||
util/rsdbbind.h \
|
||||
gxs/rsgxsutil.h \
|
||||
util/contentvalue.h \
|
||||
gxs/gxssecurity.h \
|
||||
gxs/rsgxsifacehelper.h \
|
||||
gxs/gxstokenqueue.h \
|
||||
gxs/rsgxsnetutils.h \
|
||||
gxs/rsgxsiface.h \
|
||||
gxs/rsgxsrequesttypes.h
|
||||
HEADERS += serialiser/rsnxsitems.h \
|
||||
gxs/rsgds.h \
|
||||
gxs/rsgxs.h \
|
||||
gxs/rsdataservice.h \
|
||||
gxs/rsgxsnetservice.h \
|
||||
retroshare/rsgxsflags.h \
|
||||
retroshare/rsgxsifacetypes.h \
|
||||
gxs/rsgenexchange.h \
|
||||
gxs/rsnxsobserver.h \
|
||||
gxs/rsgxsdata.h \
|
||||
retroshare/rstokenservice.h \
|
||||
gxs/rsgxsdataaccess.h \
|
||||
retroshare/rsgxsservice.h \
|
||||
serialiser/rsgxsitems.h \
|
||||
util/retrodb.h \
|
||||
util/rsdbbind.h \
|
||||
gxs/rsgxsutil.h \
|
||||
util/contentvalue.h \
|
||||
gxs/gxssecurity.h \
|
||||
gxs/rsgxsifacehelper.h \
|
||||
gxs/gxstokenqueue.h \
|
||||
gxs/rsgxsnetutils.h \
|
||||
gxs/rsgxsiface.h \
|
||||
gxs/rsgxsrequesttypes.h
|
||||
|
||||
|
||||
SOURCES += serialiser/rsnxsitems.cc \
|
||||
gxs/rsdataservice.cc \
|
||||
gxs/rsgenexchange.cc \
|
||||
gxs/rsgxsnetservice.cc \
|
||||
gxs/rsgxsdata.cc \
|
||||
serialiser/rsgxsitems.cc \
|
||||
gxs/rsgxsdataaccess.cc \
|
||||
util/retrodb.cc \
|
||||
util/contentvalue.cc \
|
||||
util/rsdbbind.cc \
|
||||
gxs/gxssecurity.cc \
|
||||
gxs/gxstokenqueue.cc \
|
||||
gxs/rsgxsnetutils.cc \
|
||||
gxs/rsgxsutil.cc \
|
||||
gxs/rsgxsrequesttypes.cc
|
||||
SOURCES += serialiser/rsnxsitems.cc \
|
||||
gxs/rsdataservice.cc \
|
||||
gxs/rsgenexchange.cc \
|
||||
gxs/rsgxsnetservice.cc \
|
||||
gxs/rsgxsdata.cc \
|
||||
serialiser/rsgxsitems.cc \
|
||||
gxs/rsgxsdataaccess.cc \
|
||||
util/retrodb.cc \
|
||||
util/contentvalue.cc \
|
||||
util/rsdbbind.cc \
|
||||
gxs/gxssecurity.cc \
|
||||
gxs/gxstokenqueue.cc \
|
||||
gxs/rsgxsnetutils.cc \
|
||||
gxs/rsgxsutil.cc \
|
||||
gxs/rsgxsrequesttypes.cc
|
||||
|
||||
|
||||
# Identity Service
|
||||
HEADERS += retroshare/rsidentity.h \
|
||||
gxs/rsgixs.h \
|
||||
services/p3idservice.h \
|
||||
serialiser/rsgxsiditems.h \
|
||||
services/p3gxsreputation.h \
|
||||
serialiser/rsgxsreputationitems.h \
|
||||
# Identity Service
|
||||
HEADERS += retroshare/rsidentity.h \
|
||||
gxs/rsgixs.h \
|
||||
services/p3idservice.h \
|
||||
serialiser/rsgxsiditems.h \
|
||||
services/p3gxsreputation.h \
|
||||
serialiser/rsgxsreputationitems.h \
|
||||
|
||||
SOURCES += services/p3idservice.cc \
|
||||
serialiser/rsgxsiditems.cc \
|
||||
services/p3gxsreputation.cc \
|
||||
serialiser/rsgxsreputationitems.cc \
|
||||
SOURCES += services/p3idservice.cc \
|
||||
serialiser/rsgxsiditems.cc \
|
||||
services/p3gxsreputation.cc \
|
||||
serialiser/rsgxsreputationitems.cc \
|
||||
|
||||
# GxsCircles Service
|
||||
HEADERS += services/p3gxscircles.h \
|
||||
serialiser/rsgxscircleitems.h \
|
||||
retroshare/rsgxscircles.h \
|
||||
# GxsCircles Service
|
||||
HEADERS += services/p3gxscircles.h \
|
||||
serialiser/rsgxscircleitems.h \
|
||||
retroshare/rsgxscircles.h \
|
||||
|
||||
SOURCES += services/p3gxscircles.cc \
|
||||
serialiser/rsgxscircleitems.cc \
|
||||
SOURCES += services/p3gxscircles.cc \
|
||||
serialiser/rsgxscircleitems.cc \
|
||||
|
||||
# GxsForums Service
|
||||
HEADERS += retroshare/rsgxsforums.h \
|
||||
services/p3gxsforums.h \
|
||||
serialiser/rsgxsforumitems.h
|
||||
# GxsForums Service
|
||||
HEADERS += retroshare/rsgxsforums.h \
|
||||
services/p3gxsforums.h \
|
||||
serialiser/rsgxsforumitems.h
|
||||
|
||||
SOURCES += services/p3gxsforums.cc \
|
||||
serialiser/rsgxsforumitems.cc \
|
||||
SOURCES += services/p3gxsforums.cc \
|
||||
serialiser/rsgxsforumitems.cc \
|
||||
|
||||
# GxsChannels Service
|
||||
HEADERS += retroshare/rsgxschannels.h \
|
||||
services/p3gxschannels.h \
|
||||
services/p3gxscommon.h \
|
||||
serialiser/rsgxscommentitems.h \
|
||||
serialiser/rsgxschannelitems.h \
|
||||
# GxsChannels Service
|
||||
HEADERS += retroshare/rsgxschannels.h \
|
||||
services/p3gxschannels.h \
|
||||
services/p3gxscommon.h \
|
||||
serialiser/rsgxscommentitems.h \
|
||||
serialiser/rsgxschannelitems.h \
|
||||
|
||||
SOURCES += services/p3gxschannels.cc \
|
||||
services/p3gxscommon.cc \
|
||||
serialiser/rsgxscommentitems.cc \
|
||||
serialiser/rsgxschannelitems.cc \
|
||||
SOURCES += services/p3gxschannels.cc \
|
||||
services/p3gxscommon.cc \
|
||||
serialiser/rsgxscommentitems.cc \
|
||||
serialiser/rsgxschannelitems.cc \
|
||||
|
||||
wikipoos {
|
||||
# Wiki Service
|
||||
HEADERS += retroshare/rswiki.h \
|
||||
services/p3wiki.h \
|
||||
@ -792,7 +788,9 @@ gxs {
|
||||
|
||||
SOURCES += services/p3wiki.cc \
|
||||
serialiser/rswikiitems.cc \
|
||||
}
|
||||
|
||||
gxsthewire {
|
||||
# Wire Service
|
||||
HEADERS += retroshare/rswire.h \
|
||||
services/p3wire.h \
|
||||
@ -800,17 +798,19 @@ gxs {
|
||||
|
||||
SOURCES += services/p3wire.cc \
|
||||
serialiser/rswireitems.cc \
|
||||
}
|
||||
|
||||
# Posted Service
|
||||
HEADERS += services/p3postbase.h \
|
||||
services/p3posted.h \
|
||||
retroshare/rsposted.h \
|
||||
serialiser/rsposteditems.h
|
||||
# Posted Service
|
||||
HEADERS += services/p3postbase.h \
|
||||
services/p3posted.h \
|
||||
retroshare/rsposted.h \
|
||||
serialiser/rsposteditems.h
|
||||
|
||||
SOURCES += services/p3postbase.cc \
|
||||
services/p3posted.cc \
|
||||
serialiser/rsposteditems.cc
|
||||
SOURCES += services/p3postbase.cc \
|
||||
services/p3posted.cc \
|
||||
serialiser/rsposteditems.cc
|
||||
|
||||
gxsphotoshare {
|
||||
#Photo Service
|
||||
HEADERS += services/p3photoservice.h \
|
||||
retroshare/rsphoto.h \
|
||||
@ -858,6 +858,3 @@ test_bitdht {
|
||||
|
||||
# ENABLED UDP NOW.
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1364,9 +1364,9 @@ int RsServer::StartupRetroShare()
|
||||
RS_SERVICE_GXS_TYPE_WIKI,
|
||||
NULL, rsInitConfig->gxs_passwd);
|
||||
|
||||
#ifdef RS_USE_WIKI
|
||||
p3Wiki *mWiki = new p3Wiki(wiki_ds, NULL, mGxsIdService);
|
||||
|
||||
// create GXS photo service
|
||||
// create GXS wiki service
|
||||
RsGxsNetService* wiki_ns = new RsGxsNetService(
|
||||
RS_SERVICE_GXS_TYPE_WIKI, wiki_ds, nxsMgr,
|
||||
mWiki, mWiki->getServiceInfo(),
|
||||
@ -1374,6 +1374,7 @@ int RsServer::StartupRetroShare()
|
||||
pgpAuxUtils);
|
||||
|
||||
mWiki->setNetworkExchangeService(wiki_ns) ;
|
||||
#endif
|
||||
|
||||
/**** Forum GXS service ****/
|
||||
|
||||
@ -1443,7 +1444,9 @@ int RsServer::StartupRetroShare()
|
||||
pqih->addService(gxsid_ns, true);
|
||||
pqih->addService(gxscircles_ns, true);
|
||||
pqih->addService(posted_ns, true);
|
||||
#ifdef RS_USE_WIKI
|
||||
pqih->addService(wiki_ns, true);
|
||||
#endif
|
||||
pqih->addService(gxsforums_ns, true);
|
||||
pqih->addService(gxschannels_ns, true);
|
||||
//pqih->addService(photo_ns, true);
|
||||
@ -1619,7 +1622,9 @@ int RsServer::StartupRetroShare()
|
||||
mConfigMgr->addConfiguration("gxschannels.cfg", gxschannels_ns);
|
||||
mConfigMgr->addConfiguration("gxscircles.cfg", gxscircles_ns);
|
||||
mConfigMgr->addConfiguration("posted.cfg", posted_ns);
|
||||
#ifdef RS_USE_WIKI
|
||||
mConfigMgr->addConfiguration("wiki.cfg", wiki_ns);
|
||||
#endif
|
||||
//mConfigMgr->addConfiguration("photo.cfg", photo_ns);
|
||||
//mConfigMgr->addConfiguration("wire.cfg", wire_ns);
|
||||
#endif
|
||||
@ -1728,7 +1733,9 @@ int RsServer::StartupRetroShare()
|
||||
// Must Set the GXS pointers before starting threads.
|
||||
rsIdentity = mGxsIdService;
|
||||
rsGxsCircles = mGxsCircles;
|
||||
#if RS_USE_WIKI
|
||||
rsWiki = mWiki;
|
||||
#endif
|
||||
rsPosted = mPosted;
|
||||
rsGxsForums = mGxsForums;
|
||||
rsGxsChannels = mGxsChannels;
|
||||
@ -1739,7 +1746,9 @@ int RsServer::StartupRetroShare()
|
||||
startServiceThread(mGxsIdService);
|
||||
startServiceThread(mGxsCircles);
|
||||
startServiceThread(mPosted);
|
||||
#if RS_USE_WIKI
|
||||
startServiceThread(mWiki);
|
||||
#endif
|
||||
startServiceThread(mGxsForums);
|
||||
startServiceThread(mGxsChannels);
|
||||
|
||||
@ -1750,7 +1759,9 @@ int RsServer::StartupRetroShare()
|
||||
startServiceThread(gxsid_ns);
|
||||
startServiceThread(gxscircles_ns);
|
||||
startServiceThread(posted_ns);
|
||||
#if RS_USE_WIKI
|
||||
startServiceThread(wiki_ns);
|
||||
#endif
|
||||
startServiceThread(gxsforums_ns);
|
||||
startServiceThread(gxschannels_ns);
|
||||
|
||||
|
@ -187,19 +187,26 @@ void p3MsgService::processMsg(RsMsgItem *mi, bool incoming)
|
||||
msi->srcId = mi->PeerId();
|
||||
mSrcIds.insert(std::pair<uint32_t, RsMsgSrcId*>(msi->msgId, msi));
|
||||
IndicateConfigChanged(); /**** INDICATE MSG CONFIG CHANGED! *****/
|
||||
|
||||
/**** STACK UNLOCKED ***/
|
||||
}
|
||||
// If the peer is allowed to push files, then auto-download the recommended files.
|
||||
|
||||
if(rsPeers->servicePermissionFlags(mi->PeerId()) & RS_NODE_PERM_ALLOW_PUSH)
|
||||
for(std::list<RsTlvFileItem>::const_iterator it(mi->attachment.items.begin());it!=mi->attachment.items.end();++it)
|
||||
rsFiles->FileRequest((*it).name,(*it).hash,(*it).filesize,std::string(),RS_FILE_REQ_ANONYMOUS_ROUTING,std::list<RsPeerId>()) ;
|
||||
|
||||
if (incoming)
|
||||
{
|
||||
// If the peer is allowed to push files, then auto-download the recommended files.
|
||||
if(rsPeers->servicePermissionFlags(mi->PeerId()) & RS_NODE_PERM_ALLOW_PUSH)
|
||||
{
|
||||
std::list<RsPeerId> srcIds;
|
||||
srcIds.push_back(mi->PeerId());
|
||||
|
||||
for(std::list<RsTlvFileItem>::const_iterator it(mi->attachment.items.begin());it!=mi->attachment.items.end();++it)
|
||||
rsFiles->FileRequest((*it).name,(*it).hash,(*it).filesize,std::string(),RS_FILE_REQ_ANONYMOUS_ROUTING,srcIds) ;
|
||||
}
|
||||
}
|
||||
|
||||
RsServer::notify()->notifyListChange(NOTIFY_LIST_MESSAGELIST,NOTIFY_TYPE_ADD);
|
||||
|
||||
/**** STACK UNLOCKED ***/
|
||||
}
|
||||
|
||||
bool p3MsgService::checkAndRebuildPartialMessage(RsMsgItem *ci)
|
||||
{
|
||||
// Check is the item is ending an incomplete item.
|
||||
|
@ -21,7 +21,7 @@ extern "C" {
|
||||
|
||||
#include <libavutil/opt.h>
|
||||
//#include <libavutil/channel_layout.h>
|
||||
//#include <libavutil/common.h>
|
||||
#include <libavutil/mem.h>
|
||||
#include <libavutil/imgutils.h>
|
||||
//#include <libavutil/mathematics.h>
|
||||
//#include <libavutil/samplefmt.h>
|
||||
@ -325,9 +325,11 @@ FFmpegVideo::FFmpegVideo()
|
||||
|
||||
//AVCodecID codec_id = AV_CODEC_ID_H264 ;
|
||||
//AVCodecID codec_id = AV_CODEC_ID_MPEG2VIDEO;
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 55
|
||||
CodecID codec_id = CODEC_ID_MPEG4;
|
||||
#else
|
||||
AVCodecID codec_id = AV_CODEC_ID_MPEG4;
|
||||
|
||||
uint8_t endcode[] = { 0, 0, 1, 0xb7 };
|
||||
#endif
|
||||
|
||||
/* find the mpeg1 video encoder */
|
||||
encoding_codec = avcodec_find_encoder(codec_id);
|
||||
@ -385,10 +387,15 @@ FFmpegVideo::FFmpegVideo()
|
||||
*/
|
||||
encoding_context->gop_size = 100;
|
||||
//encoding_context->max_b_frames = 1;
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 55
|
||||
encoding_context->pix_fmt = PIX_FMT_YUV420P; //context->pix_fmt = PIX_FMT_RGB24;
|
||||
if (codec_id == CODEC_ID_H264) {
|
||||
#else
|
||||
encoding_context->pix_fmt = AV_PIX_FMT_YUV420P; //context->pix_fmt = AV_PIX_FMT_RGB24;
|
||||
|
||||
if (codec_id == AV_CODEC_ID_H264)
|
||||
if (codec_id == AV_CODEC_ID_H264) {
|
||||
#endif
|
||||
av_opt_set(encoding_context->priv_data, "preset", "slow", 0);
|
||||
}
|
||||
|
||||
/* open it */
|
||||
if (avcodec_open2(encoding_context, encoding_codec, NULL) < 0)
|
||||
@ -428,7 +435,11 @@ FFmpegVideo::FFmpegVideo()
|
||||
|
||||
decoding_context->width = encoding_context->width;
|
||||
decoding_context->height = encoding_context->height;
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 55
|
||||
decoding_context->pix_fmt = PIX_FMT_YUV420P;
|
||||
#else
|
||||
decoding_context->pix_fmt = AV_PIX_FMT_YUV420P;
|
||||
#endif
|
||||
|
||||
if(decoding_codec->capabilities & CODEC_CAP_TRUNCATED)
|
||||
decoding_context->flags |= CODEC_FLAG_TRUNCATED; // we do not send complete frames
|
||||
@ -536,12 +547,24 @@ bool FFmpegVideo::encodeData(const QImage& image, uint32_t target_encoding_bitra
|
||||
|
||||
AVPacket pkt ;
|
||||
av_init_packet(&pkt);
|
||||
#if LIBAVCODEC_VERSION_MAJOR < 54
|
||||
pkt.size = avpicture_get_size(encoding_context->pix_fmt, encoding_context->width, encoding_context->height);
|
||||
pkt.data = (uint8_t*)av_malloc(pkt.size);
|
||||
|
||||
// do
|
||||
// {
|
||||
int ret = avcodec_encode_video(encoding_context, pkt.data, pkt.size, frame) ;
|
||||
if (ret > 0) {
|
||||
got_output = ret;
|
||||
}
|
||||
#else
|
||||
pkt.data = NULL; // packet data will be allocated by the encoder
|
||||
pkt.size = 0;
|
||||
|
||||
// do
|
||||
// {
|
||||
int ret = avcodec_encode_video2(encoding_context, &pkt, frame, &got_output) ;
|
||||
#endif
|
||||
|
||||
if (ret < 0)
|
||||
{
|
||||
@ -682,4 +705,3 @@ bool FFmpegVideo::decodeData(const RsVOIPDataChunk& chunk,QImage& image)
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
|
@ -79,7 +79,7 @@
|
||||
|
||||
/** Constructor */
|
||||
WikiDialog::WikiDialog(QWidget *parent)
|
||||
: MainPage(parent)
|
||||
: RsGxsUpdateBroadcastPage(rsWiki, parent)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
ui.setupUi(this);
|
||||
@ -103,11 +103,6 @@ WikiDialog::WikiDialog(QWidget *parent)
|
||||
connect(ui.groupTreeWidget, SIGNAL(treeCustomContextMenuRequested(QPoint)), this, SLOT(groupListCustomPopupMenu(QPoint)));
|
||||
connect(ui.groupTreeWidget, SIGNAL(treeItemActivated(QString)), this, SLOT(wikiGroupChanged(QString)));
|
||||
|
||||
|
||||
QTimer *timer = new QTimer(this);
|
||||
timer->connect(timer, SIGNAL(timeout()), this, SLOT(checkUpdate()));
|
||||
timer->start(1000);
|
||||
|
||||
/* setup TokenQueue */
|
||||
mWikiQueue = new TokenQueue(rsWiki->getTokenService(), this);
|
||||
|
||||
@ -118,8 +113,6 @@ WikiDialog::WikiDialog(QWidget *parent)
|
||||
mPopularGroups = ui.groupTreeWidget->addCategoryItem(tr("Popular Groups"), QIcon(IMAGE_FOLDERGREEN), false);
|
||||
mOtherGroups = ui.groupTreeWidget->addCategoryItem(tr("Other Groups"), QIcon(IMAGE_FOLDERYELLOW), false);
|
||||
|
||||
//Auto refresh seems not to work, temporary solution at start
|
||||
insertWikiGroups();
|
||||
}
|
||||
|
||||
WikiDialog::~WikiDialog()
|
||||
@ -127,20 +120,6 @@ WikiDialog::~WikiDialog()
|
||||
delete(mWikiQueue);
|
||||
}
|
||||
|
||||
void WikiDialog::checkUpdate()
|
||||
{
|
||||
/* update */
|
||||
if (!rsWiki)
|
||||
return;
|
||||
|
||||
if (rsWiki->updated())
|
||||
{
|
||||
insertWikiGroups();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void WikiDialog::OpenOrShowAddPageDialog()
|
||||
{
|
||||
RsGxsGroupId groupId = getSelectedGroup();
|
||||
@ -362,11 +341,6 @@ const RsGxsGroupId& WikiDialog::getSelectedGroup()
|
||||
/************************** Request / Response *************************/
|
||||
/*** Loading Main Index ***/
|
||||
|
||||
void WikiDialog::insertWikiGroups()
|
||||
{
|
||||
requestGroupMeta();
|
||||
}
|
||||
|
||||
void WikiDialog::requestGroupMeta()
|
||||
{
|
||||
std::cerr << "WikiDialog::requestGroupMeta()";
|
||||
@ -528,7 +502,7 @@ void WikiDialog::loadRequest(const TokenQueue *queue, const TokenRequest &req)
|
||||
|
||||
#define GXSGROUP_NEWGROUPID 1
|
||||
case GXSGROUP_NEWGROUPID:
|
||||
insertWikiGroups();
|
||||
requestGroupMeta();
|
||||
break;
|
||||
default:
|
||||
std::cerr << "WikiDialog::loadRequest() ERROR: INVALID TYPE";
|
||||
@ -716,3 +690,20 @@ void WikiDialog::todo()
|
||||
"<li>Auto update Group trees"
|
||||
"</ul>");
|
||||
}
|
||||
|
||||
void WikiDialog::updateDisplay(bool complete)
|
||||
{
|
||||
if (complete || !getGrpIds().empty() || !getGrpIdsMeta().empty()) {
|
||||
/* Update group list */
|
||||
requestGroupMeta();
|
||||
} else {
|
||||
/* Update all groups of changed messages */
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > msgIds;
|
||||
getAllMsgIds(msgIds);
|
||||
|
||||
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >::iterator msgIt;
|
||||
for (msgIt = msgIds.begin(); msgIt != msgIds.end(); ++msgIt) {
|
||||
wikiGroupChanged(QString::fromStdString(msgIt->first.toStdString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "retroshare-gui/mainpage.h"
|
||||
#include "gui/gxs/RsGxsUpdateBroadcastPage.h"
|
||||
#include "ui_WikiDialog.h"
|
||||
|
||||
#include <retroshare/rswiki.h>
|
||||
@ -40,7 +40,7 @@
|
||||
class WikiAddDialog;
|
||||
class WikiEditDialog;
|
||||
|
||||
class WikiDialog : public MainPage, public TokenResponse
|
||||
class WikiDialog : public RsGxsUpdateBroadcastPage, public TokenResponse
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -52,12 +52,13 @@ public:
|
||||
virtual QString pageName() const { return tr("Wiki Pages") ; } //MainPage
|
||||
virtual QString helpText() const { return ""; } //MainPage
|
||||
|
||||
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
|
||||
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
||||
public:
|
||||
virtual void updateDisplay(bool complete);
|
||||
|
||||
private slots:
|
||||
|
||||
void checkUpdate();
|
||||
void OpenOrShowAddPageDialog();
|
||||
void OpenOrShowAddGroupDialog();
|
||||
void OpenOrShowEditDialog();
|
||||
@ -69,8 +70,6 @@ private slots:
|
||||
void showGroupDetails();
|
||||
void editGroupDetails();
|
||||
|
||||
void insertWikiGroups();
|
||||
|
||||
// GroupTreeWidget stuff.
|
||||
void groupListCustomPopupMenu(QPoint point);
|
||||
void subscribeToGroup();
|
||||
|
@ -733,7 +733,7 @@ void WikiEditDialog::loadBaseHistory(const uint32_t &token)
|
||||
modItem->setText(WET_COL_DATE, text);
|
||||
modItem->setData(WET_COL_DATE, WET_ROLE_SORT, sort);
|
||||
}
|
||||
modItem->setId(page.mMeta.mAuthorId, WET_COL_AUTHORID);
|
||||
modItem->setId(page.mMeta.mAuthorId, WET_COL_AUTHORID, false);
|
||||
modItem->setText(WET_COL_PAGEID, QString::fromStdString(page.mMeta.mMsgId.toStdString()));
|
||||
|
||||
ui.treeWidget_History->addTopLevelItem(modItem);
|
||||
@ -847,7 +847,7 @@ void WikiEditDialog::loadEditTreeData(const uint32_t &token)
|
||||
modItem->setText(WET_COL_DATE, text);
|
||||
modItem->setData(WET_COL_DATE, WET_ROLE_SORT, sort);
|
||||
}
|
||||
modItem->setId(snapshot.mMeta.mAuthorId, WET_COL_AUTHORID);
|
||||
modItem->setId(snapshot.mMeta.mAuthorId, WET_COL_AUTHORID, false);
|
||||
modItem->setText(WET_COL_PAGEID, QString::fromStdString(snapshot.mMeta.mMsgId.toStdString()));
|
||||
|
||||
/* find the parent */
|
||||
|
@ -500,6 +500,10 @@ static void getNameWidget(QTreeWidget *treeWidget, QTreeWidgetItem *item, Elided
|
||||
nameLabel = new ElidedLabel(widget);
|
||||
textLabel = new ElidedLabel(widget);
|
||||
|
||||
widget->setAttribute(Qt::WA_TransparentForMouseEvents, true);
|
||||
nameLabel->setAttribute(Qt::WA_TransparentForMouseEvents, true);
|
||||
textLabel->setAttribute(Qt::WA_TransparentForMouseEvents, true);
|
||||
|
||||
widget->setProperty("nameLabel", qVariantFromValue(nameLabel));
|
||||
widget->setProperty("textLabel", qVariantFromValue(textLabel));
|
||||
|
||||
|
@ -30,17 +30,6 @@ CONFIG += gxschannels
|
||||
CONFIG += posted
|
||||
CONFIG += gxsgui
|
||||
|
||||
# Gxs is always enabled now.
|
||||
|
||||
DEFINES += RS_ENABLE_GXS
|
||||
|
||||
unfinished {
|
||||
CONFIG += gxscircles
|
||||
CONFIG += gxsthewire
|
||||
CONFIG += gxsphotoshare
|
||||
CONFIG += wikipoos
|
||||
}
|
||||
|
||||
# Other Disabled Bits.
|
||||
#CONFIG += framecatcher
|
||||
#CONFIG += blogs
|
||||
@ -80,9 +69,6 @@ linux-* {
|
||||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS *= -lX11 -lXss
|
||||
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
|
||||
#LIBS *= -lglib-2.0
|
||||
LIBS *= -rdynamic -ldl
|
||||
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
|
||||
DEFINES *= UBUNTU
|
||||
@ -199,9 +185,6 @@ win32 {
|
||||
LIBS += ../../libretroshare/src/lib/libretroshare.a
|
||||
LIBS += -L"$$LIBS_DIR/lib"
|
||||
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
LIBS += -lsqlcipher
|
||||
|
||||
LIBS += -lssl -lcrypto -lpthread -lminiupnpc -lz -lws2_32
|
||||
LIBS += -luuid -lole32 -liphlpapi -lcrypt32 -lgdi32
|
||||
LIBS += -lole32 -lwinmm
|
||||
@ -245,8 +228,6 @@ macx {
|
||||
LIBS += -framework CoreFoundation
|
||||
LIBS += -framework Security
|
||||
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
|
||||
LIBS += ../../../lib/libsqlcipher.a
|
||||
#LIBS += -lsqlite3
|
||||
|
||||
@ -266,7 +247,6 @@ freebsd-* {
|
||||
LIBS *= -lgnome-keyring
|
||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
LIBS += -lsqlite3
|
||||
}
|
||||
|
||||
@ -284,7 +264,6 @@ openbsd-* {
|
||||
LIBS *= -lgnome-keyring
|
||||
PRE_TARGETDEPS *= ../../libretroshare/src/lib/libretroshare.a
|
||||
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
LIBS += -lsqlite3
|
||||
|
||||
LIBS *= -rdynamic
|
||||
@ -302,6 +281,10 @@ openbsd-* {
|
||||
DEPENDPATH += . ../../libretroshare/src/
|
||||
INCLUDEPATH += ../../libretroshare/src/
|
||||
|
||||
wikipoos {
|
||||
LIBS += ../../supportlibs/pegmarkdown/lib/libpegmarkdown.a
|
||||
}
|
||||
|
||||
# webinterface
|
||||
DEPENDPATH += ../../libresapi/src
|
||||
INCLUDEPATH += ../../libresapi/src
|
||||
@ -1122,7 +1105,8 @@ wikipoos {
|
||||
HEADERS += gui/WikiPoos/WikiDialog.h \
|
||||
gui/WikiPoos/WikiAddDialog.h \
|
||||
gui/WikiPoos/WikiEditDialog.h \
|
||||
|
||||
gui/gxs/WikiGroupDialog.h \
|
||||
|
||||
FORMS += gui/WikiPoos/WikiDialog.ui \
|
||||
gui/WikiPoos/WikiAddDialog.ui \
|
||||
gui/WikiPoos/WikiEditDialog.ui \
|
||||
@ -1130,10 +1114,10 @@ wikipoos {
|
||||
SOURCES += gui/WikiPoos/WikiDialog.cpp \
|
||||
gui/WikiPoos/WikiAddDialog.cpp \
|
||||
gui/WikiPoos/WikiEditDialog.cpp \
|
||||
|
||||
gui/gxs/WikiGroupDialog.cpp \
|
||||
|
||||
RESOURCES += gui/WikiPoos/Wiki_images.qrc
|
||||
|
||||
DEFINES *= RS_USE_WIKI
|
||||
}
|
||||
|
||||
|
||||
@ -1307,7 +1291,6 @@ posted {
|
||||
gxsgui {
|
||||
|
||||
HEADERS += gui/gxs/GxsGroupDialog.h \
|
||||
gui/gxs/WikiGroupDialog.h \
|
||||
gui/gxs/GxsIdDetails.h \
|
||||
gui/gxs/GxsIdChooser.h \
|
||||
gui/gxs/GxsIdLabel.h \
|
||||
@ -1344,7 +1327,6 @@ gxsgui {
|
||||
# gui/gxs/GxsCommentTreeWidget.ui
|
||||
|
||||
SOURCES += gui/gxs/GxsGroupDialog.cpp \
|
||||
gui/gxs/WikiGroupDialog.cpp \
|
||||
gui/gxs/GxsIdDetails.cpp \
|
||||
gui/gxs/GxsIdChooser.cpp \
|
||||
gui/gxs/GxsIdLabel.cpp \
|
||||
|
@ -10,10 +10,6 @@ CONFIG += webui
|
||||
CONFIG -= qt xml gui
|
||||
CONFIG += link_prl
|
||||
|
||||
# if you are linking against the libretroshare with gxs.
|
||||
# this option links against the required sqlite library.
|
||||
CONFIG += gxs
|
||||
|
||||
#CONFIG += debug
|
||||
debug {
|
||||
QMAKE_CFLAGS -= -O2
|
||||
@ -97,10 +93,6 @@ win32 {
|
||||
|
||||
DEPENDPATH += $$LIBS_DIR/include
|
||||
INCLUDEPATH += $$LIBS_DIR/include
|
||||
|
||||
gxs {
|
||||
LIBS += -lsqlcipher
|
||||
}
|
||||
}
|
||||
|
||||
##################################### MacOS ######################################
|
||||
|
@ -1,3 +1,6 @@
|
||||
# Gxs is always enabled now.
|
||||
DEFINES *= RS_ENABLE_GXS
|
||||
|
||||
unix {
|
||||
isEmpty(PREFIX) { PREFIX = "/usr" }
|
||||
isEmpty(BIN_DIR) { BIN_DIR = "$${PREFIX}/bin" }
|
||||
@ -5,3 +8,12 @@ unix {
|
||||
isEmpty(LIB_DIR) { LIB_DIR = "$${PREFIX}/lib" }
|
||||
isEmpty(DATA_DIR) { DATA_DIR = "$${PREFIX}/share/RetroShare06" }
|
||||
}
|
||||
|
||||
unfinished {
|
||||
CONFIG += gxscircles
|
||||
CONFIG += gxsthewire
|
||||
CONFIG += gxsphotoshare
|
||||
CONFIG += wikipoos
|
||||
}
|
||||
|
||||
wikipoos:DEFINES *= RS_USE_WIKI
|
||||
|
@ -1,5 +1,6 @@
|
||||
TEMPLATE = lib
|
||||
CONFIG += staticlib
|
||||
CONFIG += create_prl
|
||||
CONFIG -= qt
|
||||
TARGET = pegmarkdown
|
||||
|
||||
@ -15,6 +16,7 @@ debug {
|
||||
################################# Linux ##########################################
|
||||
linux-* {
|
||||
DESTDIR = lib
|
||||
LIBS *= -lglib-2.0
|
||||
}
|
||||
|
||||
linux-g++ {
|
||||
|
Loading…
Reference in New Issue
Block a user