mirror of
https://github.com/zulip/zulip.git
synced 2026-06-30 21:11:04 +08:00
Exclude dormant users from the buddy list.
You must have accessed Zulip in the last 45 days to show up on the list. (imported from commit ebfaeb97ffda22b618be7a9206877f9d2ec53404)
This commit is contained in:
parent
50c43b45ee
commit
187469ea86
@ -28,6 +28,7 @@ import pylibmc
|
||||
import re
|
||||
import ujson
|
||||
import logging
|
||||
import datetime
|
||||
|
||||
bugdown = None
|
||||
|
||||
@ -1152,7 +1153,9 @@ class UserPresence(models.Model):
|
||||
def get_status_dict_by_realm(realm_id):
|
||||
user_statuses = defaultdict(dict)
|
||||
|
||||
dormancy_cutoff_date = datetime.datetime.now() - datetime.timedelta(days=45)
|
||||
query = UserPresence.objects.filter(
|
||||
timestamp__gte=dormancy_cutoff_date,
|
||||
user_profile__realm_id=realm_id,
|
||||
user_profile__is_active=True,
|
||||
user_profile__is_bot=False
|
||||
|
||||
Loading…
Reference in New Issue
Block a user