Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
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
Maunium
synapse
Commits
258409ef
Commit
258409ef
authored
7 years ago
by
Erik Johnston
Browse files
Options
Downloads
Patches
Plain Diff
Fix typos and reinherit
parent
bf81f3cf
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
synapse/handlers/profile.py
+6
-12
6 additions, 12 deletions
synapse/handlers/profile.py
with
6 additions
and
12 deletions
synapse/handlers/profile.py
+
6
−
12
View file @
258409ef
...
@@ -25,18 +25,12 @@ from ._base import BaseHandler
...
@@ -25,18 +25,12 @@ from ._base import BaseHandler
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
class
ProfileHandler
(
object
):
class
ProfileHandler
(
BaseHandler
):
PROFILE_UPDATE_MS
=
60
*
1000
PROFILE_UPDATE_MS
=
60
*
1000
PROFILE_UPDATE_EVERY_MS
=
24
*
60
*
60
*
1000
PROFILE_UPDATE_EVERY_MS
=
24
*
60
*
60
*
1000
def
__init__
(
self
,
hs
):
def
__init__
(
self
,
hs
):
self
.
hs
=
hs
super
(
ProfileHandler
,
self
).
__init__
(
hs
)
self
.
store
=
hs
.
get_datastore
()
self
.
clock
=
hs
.
get_clock
()
self
.
ratelimiter
=
hs
.
get_ratelimiter
()
# AWFUL hack to get at BaseHandler.ratelimit
self
.
base_handler
=
BaseHandler
(
hs
)
self
.
federation
=
hs
.
get_replication_layer
()
self
.
federation
=
hs
.
get_replication_layer
()
self
.
federation
.
register_query_handler
(
self
.
federation
.
register_query_handler
(
...
@@ -197,7 +191,7 @@ class ProfileHandler(object):
...
@@ -197,7 +191,7 @@ class ProfileHandler(object):
if
not
self
.
hs
.
is_mine
(
user
):
if
not
self
.
hs
.
is_mine
(
user
):
return
return
yield
self
.
base_handler
.
ratelimit
(
requester
)
yield
self
.
ratelimit
(
requester
)
room_ids
=
yield
self
.
store
.
get_rooms_for_user
(
room_ids
=
yield
self
.
store
.
get_rooms_for_user
(
user
.
to_string
(),
user
.
to_string
(),
...
@@ -225,7 +219,7 @@ class ProfileHandler(object):
...
@@ -225,7 +219,7 @@ class ProfileHandler(object):
)
)
def
_update_remote_profile_cache
(
self
):
def
_update_remote_profile_cache
(
self
):
"""
Called periodically to check profiles of remote users we haven
t
'
"""
Called periodically to check profiles of remote users we haven
'
t
checked in a while.
checked in a while.
"""
"""
entries
=
yield
self
.
store
.
get_remote_profile_cache_entries_that_expire
(
entries
=
yield
self
.
store
.
get_remote_profile_cache_entries_that_expire
(
...
@@ -233,10 +227,10 @@ class ProfileHandler(object):
...
@@ -233,10 +227,10 @@ class ProfileHandler(object):
)
)
for
user_id
,
displayname
,
avatar_url
in
entries
:
for
user_id
,
displayname
,
avatar_url
in
entries
:
is_sub
c
scribed
=
yield
self
.
store
.
is_subscribed_remote_profile_for_user
(
is_subscribed
=
yield
self
.
store
.
is_subscribed_remote_profile_for_user
(
user_id
,
user_id
,
)
)
if
not
is_sub
c
scribed
:
if
not
is_subscribed
:
yield
self
.
store
.
maybe_delete_remote_profile_cache
(
user_id
)
yield
self
.
store
.
maybe_delete_remote_profile_cache
(
user_id
)
continue
continue
...
...
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