Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-App-Matrix
Commits
f0f4524f
Verified
Commit
f0f4524f
authored
3 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Ensure that the bot user has joined the respective room
parent
5c6d77f5
No related branches found
No related tags found
1 merge request
!8
Resolve "Should join room before syncing (just in case)"
Checking pipeline status
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/matrix/models.py
+10
-0
10 additions, 0 deletions
aleksis/apps/matrix/models.py
with
10 additions
and
0 deletions
aleksis/apps/matrix/models.py
+
10
−
0
View file @
f0f4524f
...
...
@@ -184,6 +184,10 @@ class MatrixRoom(ExtensiblePolymorphicModel):
)
return
r
def
_ensure_joined
(
self
)
->
True
:
r
=
do_matrix_request
(
"
POST
"
,
f
"
join/
{
self
.
room_id
}
"
)
return
r
@classmethod
def
get_profiles_for_group
(
cls
,
group
:
Group
)
->
QuerySet
:
"""
Get all profile objects for the members/owners of a group.
"""
...
...
@@ -247,8 +251,13 @@ class MatrixRoom(ExtensiblePolymorphicModel):
space
.
sync
()
return
None
def
sync_room_params
(
self
):
"""
Sync all room-specific parameters, e. g. the name.
"""
self
.
_ensure_joined
()
def
sync
(
self
):
"""
Sync this room.
"""
self
.
sync_room_params
()
self
.
sync_profiles
()
if
get_site_preferences
()[
"
matrix__use_spaces
"
]:
self
.
sync_space
()
...
...
@@ -337,6 +346,7 @@ class MatrixSpace(MatrixRoom):
def
sync
(
self
):
"""
Sync this space.
"""
self
.
sync_room_params
()
self
.
ensure_children
()
self
.
sync_children
()
self
.
sync_profiles
()
...
...
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