mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 14:10:54 -04:00
Added flag to disable dbase reset, and disable dummy data creation.
This also switches to alternative test data path - to ensure it will be empty. Fixed bug in p3idservice related to dummy id creation. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6114 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
7867063734
commit
81307de7c9
8 changed files with 79 additions and 16 deletions
|
@ -118,7 +118,13 @@ p3GxsCircles::p3GxsCircles(RsGeneralDataService *gds, RsNetworkExchangeService *
|
|||
RsTickEvent::schedule_now(CIRCLE_EVENT_LOADIDS);
|
||||
|
||||
// Dummy Circles.
|
||||
|
||||
#ifndef GXS_DEV_TESTNET // NO RESET, OR DUMMYDATA for TESTNET
|
||||
|
||||
RsTickEvent::schedule_in(CIRCLE_EVENT_DUMMYSTART, CIRCLE_DUMMY_STARTPERIOD);
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -55,7 +55,13 @@ p3GxsForums::p3GxsForums(RsGeneralDataService *gds, RsNetworkExchangeService *ne
|
|||
{
|
||||
// For Dummy Msgs.
|
||||
mGenActive = false;
|
||||
|
||||
#ifndef GXS_DEV_TESTNET // NO RESET, OR DUMMYDATA for TESTNET
|
||||
|
||||
RsTickEvent::schedule_in(FORUM_TESTEVENT_DUMMYDATA, DUMMYDATA_PERIOD);
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void p3GxsForums::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
||||
|
|
|
@ -38,11 +38,11 @@
|
|||
|
||||
/****
|
||||
* #define ID_DEBUG 1
|
||||
* #define GXSID_GEN_DUMMY_DATA 1
|
||||
****/
|
||||
|
||||
#define GXSID_GEN_DUMMY_DATA 1
|
||||
|
||||
|
||||
|
||||
#define ID_REQUEST_LIST 0x0001
|
||||
#define ID_REQUEST_IDENTITY 0x0002
|
||||
#define ID_REQUEST_REPUTATION 0x0003
|
||||
|
@ -129,13 +129,17 @@ p3IdService::p3IdService(RsGeneralDataService *gds, RsNetworkExchangeService *ne
|
|||
mBgSchedule_Active = false;
|
||||
|
||||
// Kick off Cache Testing, + Others.
|
||||
RsTickEvent::schedule_in(GXSID_EVENT_CACHETEST, CACHETEST_PERIOD);
|
||||
RsTickEvent::schedule_in(GXSID_EVENT_PGPHASH, PGPHASH_PERIOD);
|
||||
RsTickEvent::schedule_in(GXSID_EVENT_REPUTATION, REPUTATION_PERIOD);
|
||||
RsTickEvent::schedule_now(GXSID_EVENT_CACHEOWNIDS);
|
||||
|
||||
#ifdef GXSID_GEN_DUMMY_DATA
|
||||
#ifndef GXS_DEV_TESTNET // NO RESET, OR DUMMYDATA for TESTNET
|
||||
|
||||
RsTickEvent::schedule_in(GXSID_EVENT_CACHETEST, CACHETEST_PERIOD);
|
||||
|
||||
#ifdef GXSID_GEN_DUMMY_DATA
|
||||
RsTickEvent::schedule_now(GXSID_EVENT_DUMMYDATA);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
|
@ -1156,6 +1160,9 @@ static void calcPGPHash(const RsGxsId &id, const PGPFingerprintType &pgp, GxsIdP
|
|||
// Must Use meta.
|
||||
void p3IdService::service_CreateGroup(RsGxsGrpItem* grpItem, RsTlvSecurityKeySet& keySet)
|
||||
{
|
||||
std::cerr << "p3IdService::service_CreateGroup()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
RsGxsIdGroupItem *item = dynamic_cast<RsGxsIdGroupItem *>(grpItem);
|
||||
if (!item)
|
||||
{
|
||||
|
@ -1219,29 +1226,25 @@ void p3IdService::service_CreateGroup(RsGxsGrpItem* grpItem, RsTlvSecurityKeySet
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
std::cerr << "p3IdService::service_CreateGroup() for : " << item->group.mMeta.mGroupId;
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "p3IdService::service_CreateGroup() Alt GroupId : " << item->meta.mGroupId;
|
||||
std::cerr << std::endl;
|
||||
|
||||
#ifdef GXSID_GEN_DUMMY_DATA
|
||||
if ((item->group.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID) && (item->group.mMeta.mAuthorId != ""))
|
||||
#else
|
||||
if (item->group.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID)
|
||||
#endif
|
||||
{
|
||||
/* create the hash */
|
||||
GxsIdPgpHash hash;
|
||||
|
||||
/* */
|
||||
PGPFingerprintType ownFinger;
|
||||
#ifdef GXSID_GEN_DUMMY_DATA
|
||||
PGPIdType ownId(item->group.mMeta.mAuthorId);
|
||||
#else
|
||||
PGPIdType ownId(AuthGPG::getAuthGPG()->getGPGOwnId());
|
||||
|
||||
#ifdef GXSID_GEN_DUMMY_DATA
|
||||
if (item->group.mMeta.mAuthorId != "")
|
||||
{
|
||||
ownId = PGPIdType(item->group.mMeta.mAuthorId);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!AuthGPG::getAuthGPG()->getKeyFingerprint(ownId,ownFinger))
|
||||
|
@ -1254,6 +1257,9 @@ void p3IdService::service_CreateGroup(RsGxsGrpItem* grpItem, RsTlvSecurityKeySet
|
|||
calcPGPHash(item->group.mMeta.mGroupId, ownFinger, hash);
|
||||
item->group.mPgpIdHash = hash.toStdString();
|
||||
|
||||
std::cerr << "p3IdService::service_CreateGroup() Calculated PgpIdHash : " << item->group.mPgpIdHash;
|
||||
std::cerr << std::endl;
|
||||
|
||||
/* do signature */
|
||||
|
||||
#if ENABLE_PGP_SIGNATURES
|
||||
|
@ -1526,6 +1532,17 @@ bool p3IdService::checkId(const RsGxsIdGroup &grp, PGPIdType &pgpId)
|
|||
std::cerr << grp.mMeta.mGroupId;
|
||||
std::cerr << std::endl;
|
||||
|
||||
/* some sanity checking... make sure hash is the right size */
|
||||
|
||||
std::cerr << "p3IdService::checkId() PgpIdHash is: " << grp.mPgpIdHash;
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (grp.mPgpIdHash.length() != SHA_DIGEST_LENGTH * 2)
|
||||
{
|
||||
std::cerr << "ERROR PgpIdHash len:" << grp.mPgpIdHash.length();
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
/* iterate through and check hash */
|
||||
GxsIdPgpHash ans(grp.mPgpIdHash);
|
||||
|
||||
|
|
|
@ -94,6 +94,8 @@ p3PhotoService::p3PhotoService(RsGeneralDataService* gds, RsNetworkExchangeServi
|
|||
|
||||
// create dummy grps
|
||||
|
||||
#ifndef GXS_DEV_TESTNET // NO RESET, OR DUMMYDATA for TESTNET
|
||||
|
||||
RsGxsPhotoAlbumItem* item1 = new RsGxsPhotoAlbumItem(), *item2 = new RsGxsPhotoAlbumItem();
|
||||
|
||||
item1->meta.mGroupName = "Dummy Album 1";
|
||||
|
@ -105,6 +107,10 @@ p3PhotoService::p3PhotoService(RsGeneralDataService* gds, RsNetworkExchangeServi
|
|||
|
||||
createDummyGroup(item1);
|
||||
createDummyGroup(item2);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool p3PhotoService::updated()
|
||||
|
|
|
@ -64,10 +64,14 @@ void p3Posted::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
|||
void p3Posted::service_tick()
|
||||
{
|
||||
|
||||
#ifndef GXS_DEV_TESTNET // DISABLE DUMMYDATA if TEST_NET
|
||||
|
||||
generateTopics();
|
||||
generatePosts();
|
||||
generateVotesAndComments();
|
||||
|
||||
#endif
|
||||
|
||||
// time_t now = time(NULL);
|
||||
//
|
||||
// if((now > (time_t) (VOTE_UPDATE_PERIOD + mLastUpdate)) &&
|
||||
|
|
|
@ -54,8 +54,10 @@ p3Wiki::p3Wiki(RsGeneralDataService* gds, RsNetworkExchangeService* nes)
|
|||
mImprovActive = false;
|
||||
mMarkdownActive = false;
|
||||
|
||||
#ifdef WIKI_GEN_DUMMY_DATA
|
||||
#ifndef GXS_DEV_TESTNET // NO RESET, OR DUMMYDATA for TESTNET
|
||||
#ifdef WIKI_GEN_DUMMY_DATA
|
||||
RsTickEvent::schedule_in(WIKI_EVENT_DUMMYSTART, DUMMYSTART_PERIOD);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue