Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
conduwuit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
🥺
conduwuit
Commits
c896acb7
Commit
c896acb7
authored
7 months ago
by
🥺
Browse files
Options
Downloads
Patches
Plain Diff
dont consider presence status changes apart of presence spam
Signed-off-by:
strawberry
<
strawberry@puppygock.gay
>
parent
7f1bc490
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/service/presence/data.rs
+19
-3
19 additions, 3 deletions
src/service/presence/data.rs
with
19 additions
and
3 deletions
src/service/presence/data.rs
+
19
−
3
View file @
c896acb7
...
...
@@ -61,6 +61,22 @@ pub(super) fn set_presence(
Some
(
ref
presence
)
=>
presence
.1
.content.presence
!=
*
presence_state
,
};
let
status_msg_changed
=
match
last_presence
{
None
=>
true
,
Some
(
ref
last_presence
)
=>
{
let
old_msg
=
last_presence
.1
.content
.status_msg
.clone
()
.unwrap_or_default
();
let
new_msg
=
status_msg
.clone
()
.unwrap_or_default
();
new_msg
!=
old_msg
},
};
let
now
=
utils
::
millis_since_unix_epoch
();
let
last_last_active_ts
=
match
last_presence
{
None
=>
0
,
...
...
@@ -72,10 +88,10 @@ pub(super) fn set_presence(
Some
(
last_active_ago
)
=>
now
.saturating_sub
(
last_active_ago
.into
()),
};
// tighten for state flicker?
if
!
state_changed
&&
last_active_ts
<
=
last_last_active_ts
{
//
TODO:
tighten for state flicker?
if
!
status_msg_changed
&&
!
state_changed
&&
last_active_ts
<
last_last_active_ts
{
debug_warn!
(
"presence spam {:?} last_active_ts:{:?} <
=
{:?}"
,
"presence spam {:?} last_active_ts:{:?} < {:?}"
,
user_id
,
last_active_ts
,
last_last_active_ts
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment