mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-26 07:59:35 -05:00
added last seen display info in circles to help debugging auto-cleaning of circles
This commit is contained in:
parent
e0ed60ee6f
commit
c9a92bc58a
@ -1381,6 +1381,11 @@ bool RsGenExchange::getGroupMeta(const uint32_t &token, std::list<RsGroupMetaDat
|
||||
m.mVisibleMsgCount = 0 ;
|
||||
}
|
||||
|
||||
// We could save this in the net service, but it's a bit more than that since some services have
|
||||
// specific usage footprints for their groups.
|
||||
|
||||
m.mLastSeen = (IS_GROUP_SUBSCRIBED(gMeta.mSubscribeFlags)) ? time(nullptr) : service_getLastGroupUsageTs(gMeta.mGroupId);
|
||||
|
||||
groupInfo.push_back(m);
|
||||
}
|
||||
|
||||
|
@ -666,7 +666,7 @@ protected:
|
||||
* that the group is always in use.
|
||||
*/
|
||||
virtual bool service_checkIfGroupIsStillUsed(const RsGxsGrpMetaData& /* meta */) { return true; } // see RsGenExchange
|
||||
|
||||
virtual rstime_t service_getLastGroupUsageTs(const RsGxsGroupId&) { return 0; }
|
||||
public:
|
||||
|
||||
/*!
|
||||
|
@ -91,6 +91,7 @@ struct RsGroupMetaData : RsSerializable
|
||||
uint32_t mPop; // Popularity = number of friend subscribers
|
||||
uint32_t mVisibleMsgCount; // Max messages reported by friends
|
||||
rstime_t mLastPost; // Timestamp for last message. Not used yet.
|
||||
rstime_t mLastSeen; // Last time the group was advertised by friends.
|
||||
|
||||
uint32_t mGroupStatus;
|
||||
|
||||
|
@ -1700,6 +1700,20 @@ bool p3GxsCircles::locked_checkCircleCacheForAutoSubscribe(RsGxsCircleCache& cac
|
||||
return true;
|
||||
}
|
||||
|
||||
rstime_t p3GxsCircles::service_getLastGroupUsageTs(const RsGxsGroupId& gid)
|
||||
{
|
||||
rstime_t now = time(nullptr);
|
||||
|
||||
RS_STACK_MUTEX(mKnownCirclesMtx);
|
||||
|
||||
auto it = mKnownCircles.find(gid);
|
||||
bool unknown_posted = (it == mKnownCircles.end());
|
||||
|
||||
if(unknown_posted)
|
||||
return now;
|
||||
else
|
||||
return it->second;
|
||||
}
|
||||
bool p3GxsCircles::service_checkIfGroupIsStillUsed(const RsGxsGrpMetaData& meta)
|
||||
{
|
||||
#ifdef GXSFORUMS_CHANNELS
|
||||
|
@ -290,6 +290,7 @@ public:
|
||||
virtual void updateGroup(uint32_t &token, RsGxsCircleGroup &group) override;
|
||||
|
||||
virtual bool service_checkIfGroupIsStillUsed(const RsGxsGrpMetaData& meta) override;
|
||||
virtual rstime_t service_getLastGroupUsageTs(const RsGxsGroupId&) override;
|
||||
|
||||
/* membership management for external circles */
|
||||
|
||||
|
@ -695,7 +695,12 @@ void IdDialog::loadCircles(const std::list<RsGroupMetaData>& groupInfo)
|
||||
if(am_I_subscribed)
|
||||
tooltip += tr("subscribed (Receive/forward membership requests from others and invite list).") ;
|
||||
else
|
||||
tooltip += tr("unsubscribed (Only receive invite list).") ;
|
||||
{
|
||||
if(vit->mLastSeen>0)
|
||||
tooltip += tr("unsubscribed (Only receive invite list). Last seen: %1 days ago.").arg( (time(nullptr)-vit->mLastSeen)/86400 );
|
||||
else
|
||||
tooltip += tr("unsubscribed (Only receive invite list).");
|
||||
}
|
||||
|
||||
tooltip += "\n"+tr("Your status: ") ;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user