mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-27 10:59:53 +00:00
Exclude staff from activity recording
This commit is contained in:
parent
c90e8c08a6
commit
ebaf3224fd
2 changed files with 7 additions and 3 deletions
|
@ -314,9 +314,10 @@ impl Server {
|
|||
|(project_id, project)| {
|
||||
project.guests.values().chain([&project.host]).filter_map(
|
||||
|collaborator| {
|
||||
if collaborator
|
||||
.last_activity
|
||||
.map_or(false, |activity| activity > period_start)
|
||||
if !collaborator.admin
|
||||
&& collaborator
|
||||
.last_activity
|
||||
.map_or(false, |activity| activity > period_start)
|
||||
{
|
||||
Some((collaborator.user_id, *project_id))
|
||||
} else {
|
||||
|
|
|
@ -52,6 +52,7 @@ pub struct Collaborator {
|
|||
pub user_id: UserId,
|
||||
#[serde(skip)]
|
||||
pub last_activity: Option<OffsetDateTime>,
|
||||
pub admin: bool,
|
||||
}
|
||||
|
||||
#[derive(Default, Serialize)]
|
||||
|
@ -340,6 +341,7 @@ impl Store {
|
|||
user_id: connection.user_id,
|
||||
replica_id: 0,
|
||||
last_activity: None,
|
||||
admin: connection.admin,
|
||||
},
|
||||
guests: Default::default(),
|
||||
join_requests: Default::default(),
|
||||
|
@ -541,6 +543,7 @@ impl Store {
|
|||
replica_id,
|
||||
user_id: requester_id,
|
||||
last_activity: Some(OffsetDateTime::now_utc()),
|
||||
admin: requester_connection.admin,
|
||||
},
|
||||
);
|
||||
receipts_with_replica_ids.push((receipt, replica_id));
|
||||
|
|
Loading…
Reference in a new issue