mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-28 00:45:34 -04:00
cleaned the mess in Circles, due to mixing up GxsIds and PgpIds, which is now irrelevant because items for external circles are not sent based on PGP signatures anymore
This commit is contained in:
parent
c14c240f07
commit
34bd998c8e
12 changed files with 178 additions and 238 deletions
|
@ -315,7 +315,7 @@ void mark_circle_item(QTreeWidgetItem *item, const std::set<RsPgpId> &names)
|
|||
std::set<RsPgpId>::iterator it;
|
||||
for(it = names.begin(); it != names.end(); ++it)
|
||||
{
|
||||
if (details.mAllowedSignedPeers.end() != details.mAllowedSignedPeers.find(*it))
|
||||
if (details.mAllowedNodes.end() != details.mAllowedNodes.find(*it))
|
||||
{
|
||||
set_item_background(item, GREEN_BACKGROUND);
|
||||
std::cerr << "CirclesDialog mark_circle_item: found match: " << id;
|
||||
|
@ -387,15 +387,7 @@ void CirclesDialog::circle_selected()
|
|||
if (rsGxsCircles->getCircleDetails(id, details))
|
||||
{
|
||||
/* now mark all the members */
|
||||
std::set<RsPgpId> members;
|
||||
for( std::map<RsPgpId, std::set<RsGxsId> >::iterator it = details.mAllowedSignedPeers.begin(); it != details.mAllowedSignedPeers.end(); ++it)
|
||||
{
|
||||
members.insert(it->first);
|
||||
std::cerr << "Circle member: " << it->first;
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
|
||||
mark_matching_tree(ui.treeWidget_friends, members, CIRCLEGROUP_FRIEND_COL_ID, GREEN_BACKGROUND);
|
||||
mark_matching_tree(ui.treeWidget_friends, details.mAllowedNodes, CIRCLEGROUP_FRIEND_COL_ID, GREEN_BACKGROUND);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -300,8 +300,8 @@ void CreateCircleDialog::addMember(const QString& keyId, const QString& idtype,
|
|||
void CreateCircleDialog::addCircle(const RsGxsCircleDetails &cirDetails)
|
||||
{
|
||||
typedef std::set<RsGxsId>::iterator itUnknownPeers;
|
||||
for (itUnknownPeers it = cirDetails.mAllowedAnonPeers.begin()
|
||||
; it != cirDetails.mAllowedAnonPeers.end()
|
||||
for (itUnknownPeers it = cirDetails.mAllowedGxsIds.begin()
|
||||
; it != cirDetails.mAllowedGxsIds.end()
|
||||
; ++it) {
|
||||
RsGxsId gxs_id = *it;
|
||||
RsIdentityDetails gxs_details ;
|
||||
|
@ -316,10 +316,10 @@ void CreateCircleDialog::addCircle(const RsGxsCircleDetails &cirDetails)
|
|||
}//if(!gxs_id.isNull() && rsIdentity->getIdDetails(gxs_id,gxs_details))
|
||||
}//for (itUnknownPeers it = cirDetails.mUnknownPeers.begin()
|
||||
|
||||
typedef std::map<RsPgpId, std::set<RsGxsId> >::const_iterator itAllowedPeers;
|
||||
for (itAllowedPeers it = cirDetails.mAllowedSignedPeers.begin() ; it != cirDetails.mAllowedSignedPeers.end() ; ++it )
|
||||
typedef std::set<RsPgpId>::const_iterator itAllowedPeers;
|
||||
for (itAllowedPeers it = cirDetails.mAllowedNodes.begin() ; it != cirDetails.mAllowedNodes.end() ; ++it )
|
||||
{
|
||||
RsPgpId gpg_id = it->first;
|
||||
RsPgpId gpg_id = *it;
|
||||
RsPeerDetails details ;
|
||||
if(!gpg_id.isNull() && rsPeers->getGPGDetails(gpg_id,details)) {
|
||||
|
||||
|
|
|
@ -501,13 +501,10 @@ void IdDialog::loadCircleGroupMeta(const uint32_t &token)
|
|||
item->setFont(CIRCLEGROUP_CIRCLE_COL_GROUPFLAGS,font) ;
|
||||
}
|
||||
|
||||
|
||||
#ifdef ID_DEBUG
|
||||
if (subscribed)
|
||||
item->setIcon(CIRCLEGROUP_CIRCLE_COL_GROUPNAME,QIcon(":icons/bullet_green_128.png")) ;
|
||||
else
|
||||
item->setIcon(CIRCLEGROUP_CIRCLE_COL_GROUPNAME,QIcon(":icons/bullet_yellow_128.png")) ;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,6 +38,17 @@ CircleWidget::~CircleWidget()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
static bool same_RsGxsCircleDetails(const RsGxsCircleDetails& d1,const RsGxsCircleDetails& d2)
|
||||
{
|
||||
return ( d1.mCircleId == d2.mCircleId
|
||||
&& d1.mCircleName == d2.mCircleName
|
||||
&& d1.mCircleType == d2.mCircleType
|
||||
&& d1.mIsExternal == d2.mIsExternal
|
||||
&& d1.mAllowedGxsIds== d2.mAllowedGxsIds
|
||||
&& d1.mAllowedNodes == d2.mAllowedNodes
|
||||
);
|
||||
}
|
||||
|
||||
void CircleWidget::updateData(const RsGroupMetaData& gxs_group_info
|
||||
, const RsGxsCircleDetails& details)
|
||||
{
|
||||
|
@ -49,40 +60,40 @@ void CircleWidget::updateData(const RsGroupMetaData& gxs_group_info
|
|||
ui->label->setText(m_myName);
|
||||
ui->label->setToolTip(m_myName);
|
||||
update();
|
||||
//}//if (_group_info != gxs_group_info)
|
||||
//}
|
||||
|
||||
if (_circle_details != details) {
|
||||
if(!same_RsGxsCircleDetails(_circle_details , details))
|
||||
{
|
||||
_circle_details=details;
|
||||
typedef std::set<RsGxsId>::iterator itUnknownPeers;
|
||||
for (itUnknownPeers it = _circle_details.mAllowedAnonPeers.begin()
|
||||
; it != _circle_details.mAllowedAnonPeers.end()
|
||||
for (itUnknownPeers it = _circle_details.mAllowedGxsIds.begin()
|
||||
; it != _circle_details.mAllowedGxsIds.end()
|
||||
; ++it) {
|
||||
RsGxsId gxs_id = *it;
|
||||
if(!gxs_id.isNull()) {
|
||||
emit askForGXSIdentityWidget(gxs_id);
|
||||
}//if(!gxs_id.isNull())
|
||||
}//for (itUnknownPeers it = _circle_details.mUnknownPeers.begin()
|
||||
}
|
||||
}
|
||||
|
||||
typedef std::map<RsPgpId, std::set<RsGxsId> >::const_iterator itAllowedPeers;
|
||||
for (itAllowedPeers it = _circle_details.mAllowedSignedPeers.begin() ; it != _circle_details.mAllowedSignedPeers.end() ; ++it )
|
||||
typedef std::set<RsPgpId>::const_iterator itAllowedPeers;
|
||||
for (itAllowedPeers it = _circle_details.mAllowedNodes.begin() ; it != _circle_details.mAllowedNodes.end() ; ++it )
|
||||
{
|
||||
RsPgpId pgp_id = it->first;
|
||||
RsPgpId pgp_id = *it;
|
||||
emit askForPGPIdentityWidget(pgp_id);
|
||||
|
||||
std::set<RsGxsId> gxs_id_list = it->second;
|
||||
typedef std::set<RsGxsId>::const_iterator itGxsId;
|
||||
for (itGxsId curs=gxs_id_list.begin()
|
||||
; curs != gxs_id_list.end()
|
||||
; ++curs) {
|
||||
RsGxsId gxs_id = *curs;
|
||||
if(!gxs_id.isNull()) {
|
||||
emit askForGXSIdentityWidget(gxs_id);
|
||||
}//if(!gxs_id.isNull())
|
||||
}//for (itGxsId curs=gxs_id_list.begin()
|
||||
}//for (itAllowedPeers it = _circle_details.mAllowedPeers.begin()
|
||||
// std::set<RsGxsId> gxs_id_list = it->second;
|
||||
// typedef std::set<RsGxsId>::const_iterator itGxsId;
|
||||
// for (itGxsId curs=gxs_id_list.begin(); curs != gxs_id_list.end(); ++curs)
|
||||
// {
|
||||
// RsGxsId gxs_id = *curs;
|
||||
// if(!gxs_id.isNull())
|
||||
// emit askForGXSIdentityWidget(gxs_id);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
update();
|
||||
}//if (details!=_circle_details)
|
||||
}
|
||||
}
|
||||
|
||||
QSize CircleWidget::sizeHint()
|
||||
|
|
|
@ -441,7 +441,7 @@ void GxsGroupDialog::updateFromExistingMeta(const QString &description)
|
|||
|
||||
switch(mGrpMeta.mCircleType)
|
||||
{
|
||||
case GXS_CIRCLE_TYPE_YOUREYESONLY:
|
||||
case GXS_CIRCLE_TYPE_YOUR_FRIENDS_ONLY:
|
||||
ui.typeLocal->setChecked(true);
|
||||
distribution_string = tr("Your friends only") ;
|
||||
ui.localComboBox->loadCircles(GXS_CIRCLE_CHOOSER_PERSONAL, mGrpMeta.mInternalCircle);
|
||||
|
@ -740,7 +740,7 @@ bool GxsGroupDialog::setCircleParameters(RsGroupMetaData &meta)
|
|||
}
|
||||
else if (ui.typeLocal->isChecked())
|
||||
{
|
||||
meta.mCircleType = GXS_CIRCLE_TYPE_YOUREYESONLY;
|
||||
meta.mCircleType = GXS_CIRCLE_TYPE_YOUR_FRIENDS_ONLY;
|
||||
meta.mCircleId.clear();
|
||||
meta.mOriginator.clear();
|
||||
meta.mInternalCircle.clear() ;
|
||||
|
|
|
@ -817,7 +817,7 @@ void GxsForumThreadWidget::insertGroupData()
|
|||
distrib_string = tr("Restricted to members of circle ")+QString::fromStdString(group.mMeta.mCircleId.toStdString()) ;
|
||||
}
|
||||
break ;
|
||||
case GXS_CIRCLE_TYPE_YOUREYESONLY: distrib_string = tr("Your eyes only");
|
||||
case GXS_CIRCLE_TYPE_YOUR_FRIENDS_ONLY: distrib_string = tr("Your eyes only");
|
||||
break ;
|
||||
case GXS_CIRCLE_TYPE_LOCAL: distrib_string = tr("You and your friend nodes");
|
||||
break ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue