Merge pull request #350 from csoler/v0.6-Circles

V0.6 circles
This commit is contained in:
Cyril Soler 2016-04-14 23:49:55 -04:00
commit cb6c2c9199
4 changed files with 17 additions and 18 deletions

View File

@ -2840,8 +2840,8 @@ void RsGenExchange::processRecvdGroups()
// now check if group already existss
if(std::find(existingGrpIds.begin(), existingGrpIds.end(), grp->grpId) == existingGrpIds.end())
{
if(meta->mCircleType == GXS_CIRCLE_TYPE_YOUREYESONLY)
meta->mOriginator = grp->PeerId();
//if(meta->mCircleType == GXS_CIRCLE_TYPE_YOUREYESONLY)
meta->mOriginator = grp->PeerId();
meta->mSubscribeFlags = GXS_SERV::GROUP_SUBSCRIBE_NOT_SUBSCRIBED;

View File

@ -119,9 +119,8 @@ p3GxsCircles::p3GxsCircles(RsGeneralDataService *gds, RsNetworkExchangeService *
RsTickEvent::schedule_now(CIRCLE_EVENT_LOADIDS);
// Dummy Circles.
// RsTickEvent::schedule_in(CIRCLE_EVENT_DUMMYSTART, CIRCLE_DUMMY_STARTPERIOD);
mDummyIdToken = 0;
// RsTickEvent::schedule_in(CIRCLE_EVENT_DUMMYSTART, CIRCLE_DUMMY_STARTPERIOD);
mDummyIdToken = 0;
}
@ -978,6 +977,7 @@ bool p3GxsCircles::cache_load_for_token(uint32_t token)
RsGxsCircleCache &cache = it->second;
cache.loadBaseCircle(group);
cache.mOriginator = item->meta.mOriginator ;
delete item;
@ -1043,6 +1043,8 @@ bool p3GxsCircles::cache_load_for_token(uint32_t token)
#endif
std::list<PeerId> peers;
peers.push_back(cache.mOriginator) ;
mIdentities->requestKey(*pit, peers);
/* store in to_process queue. */
@ -1114,12 +1116,12 @@ bool p3GxsCircles::cache_load_for_token(uint32_t token)
isUnprocessedPeers = false;
}
// we can check for self inclusion in the circle right away, since own ids are always loaded.
// that allows to subscribe/unsubscribe uncomplete circles
checkCircleCacheForAutoSubscribe(cache);
if (isComplete)
{
checkCircleCacheForAutoSubscribe(cache);
/* move straight into the cache */
mCircleCache.store(id, cache);
mCircleCache.resize();
@ -1266,8 +1268,11 @@ bool p3GxsCircles::cache_reloadids(const RsGxsCircleId &circleId)
/* We need to AutoSubscribe if the Circle is relevent to us */
bool p3GxsCircles::checkCircleCacheForAutoSubscribe(RsGxsCircleCache &cache)
{
#warning we should also check for items in mLoadingCache in this method.
#ifdef DEBUG_CIRCLES
std::cerr << "p3GxsCircles::checkCircleCacheForAutoSubscribe() : "<< cache.mCircleId << std::endl;
#endif

View File

@ -156,6 +156,8 @@ class RsGxsCircleCache
std::set<RsGxsId> mAllowedAnonPeers;
std::map<RsPgpId, std::set<RsGxsId> > mAllowedSignedPeers;
RsPeerId mOriginator ; // peer who sent the data, in case we need to ask for ids
};

View File

@ -882,9 +882,6 @@ bool IdDialog::fillIdListItem(const RsGxsIdGroup& data, QTreeWidgetItem *&item,
item->setToolTip(RSID_COL_IDTYPE, tooltip) ;
}
#ifdef ID_DEBUG
std::cerr << "Setting item image : " << pixmap.width() << " x " << pixmap.height() << std::endl;
#endif
QPixmap pixmap ;
if(data.mImage.mSize == 0 || !pixmap.loadFromData(data.mImage.mData, data.mImage.mSize, "PNG"))
@ -1119,7 +1116,7 @@ void IdDialog::insertIdDetails(uint32_t token)
pixmap = QPixmap::fromImage(GxsIdDetails::makeDefaultIcon(RsGxsId(data.mMeta.mGroupId))) ;
#ifdef ID_DEBUG
std::cerr << "Setting header frame image : " << pix.width() << " x " << pix.height() << std::endl;
std::cerr << "Setting header frame image : " << pixmap.width() << " x " << pixmap.height() << std::endl;
#endif
ui->avlabel->setPixmap(pixmap);
@ -1263,7 +1260,7 @@ void IdDialog::modifyReputation()
rsReputations->setOwnOpinion(id,op) ;
#ifdef ID_DEBUG
std::cerr << "IdDialog::modifyReputation() ID: " << id << " Mod: " << mod;
std::cerr << "IdDialog::modifyReputation() ID: " << id << " Mod: " << op;
std::cerr << std::endl;
#endif
@ -1281,11 +1278,6 @@ void IdDialog::modifyReputation()
}
#endif
#ifdef ID_DEBUG
std::cerr << "IdDialog::modifyReputation() queuingRequest(), token: " << token;
std::cerr << std::endl;
#endif
// trigger refresh when finished.
// basic / anstype are not needed.
requestIdDetails();