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
Package registry
Container Registry
Model registry
Operate
Terraform modules
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
Timo Ley
synapse
Commits
16565e67
Commit
16565e67
authored
6 years ago
by
Andrew Morgan
Browse files
Options
Downloads
Patches
Plain Diff
Correct docstring types and chunk logic
parent
40c22716
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/room_list.py
+11
-10
11 additions, 10 deletions
synapse/handlers/room_list.py
with
11 additions
and
10 deletions
synapse/handlers/room_list.py
+
11
−
10
View file @
16565e67
...
@@ -59,9 +59,9 @@ class RoomListHandler(BaseHandler):
...
@@ -59,9 +59,9 @@ class RoomListHandler(BaseHandler):
party network. A client can ask for a specific list or to return all.
party network. A client can ask for a specific list or to return all.
Args:
Args:
limit (int)
limit (int
|None
)
since_token (str)
since_token (str
|None
)
search_filter (dict)
search_filter (dict
|None
)
network_tuple (ThirdPartyInstanceID): Which public list to use.
network_tuple (ThirdPartyInstanceID): Which public list to use.
This can be (None, None) to indicate the main list, or a particular
This can be (None, None) to indicate the main list, or a particular
appservice and network id to use an appservice specific one.
appservice and network id to use an appservice specific one.
...
@@ -102,16 +102,16 @@ class RoomListHandler(BaseHandler):
...
@@ -102,16 +102,16 @@ class RoomListHandler(BaseHandler):
"""
Generate a public room list.
"""
Generate a public room list.
Args:
Args:
limit (int): Maximum amount of rooms to return.
limit (int
|None
): Maximum amount of rooms to return.
since_token (str)
since_token (str
|None
)
search_filter (dict): Dictionary to filter rooms by.
search_filter (dict
|None
): Dictionary to filter rooms by.
network_tuple (ThirdPartyInstanceID): Which public list to use.
network_tuple (ThirdPartyInstanceID): Which public list to use.
This can be (None, None) to indicate the main list, or a particular
This can be (None, None) to indicate the main list, or a particular
appservice and network id to use an appservice specific one.
appservice and network id to use an appservice specific one.
Setting to None returns all public rooms across all lists.
Setting to None returns all public rooms across all lists.
from_federation (bool): Whether this request originated from a
from_federation (bool): Whether this request originated from a
federating server or a client. Used for room filtering.
federating server or a client. Used for room filtering.
timeout (int): Amount of seconds to wait for a response before
timeout (int
|None
): Amount of seconds to wait for a response before
timing out.
timing out.
"""
"""
if
since_token
and
since_token
!=
"
END
"
:
if
since_token
and
since_token
!=
"
END
"
:
...
@@ -316,9 +316,9 @@ class RoomListHandler(BaseHandler):
...
@@ -316,9 +316,9 @@ class RoomListHandler(BaseHandler):
room_id (str): The ID of the room.
room_id (str): The ID of the room.
num_joined_users (int): The number of joined users in the room.
num_joined_users (int): The number of joined users in the room.
chunk (list)
chunk (list)
limit (int): Maximum amount of rooms to display. Function will
limit (int
|None
): Maximum amount of rooms to display. Function will
return if length of chunk is greater than limit + 1.
return if length of chunk is greater than limit + 1.
search_filter (dict)
search_filter (dict
|None
)
from_federation (bool): Whether this request originated from a
from_federation (bool): Whether this request originated from a
federating server or a client. Used for room filtering.
federating server or a client. Used for room filtering.
"""
"""
...
@@ -330,7 +330,8 @@ class RoomListHandler(BaseHandler):
...
@@ -330,7 +330,8 @@ class RoomListHandler(BaseHandler):
if
not
result
:
if
not
result
:
return
return
if
from_federation
and
result
[
"
m.federate
"
]
is
False
:
if
from_federation
:
if
"
m.federate
"
in
result
and
not
result
[
"
m.federate
"
]:
# This is a room that other servers cannot join. Do not show them
# This is a room that other servers cannot join. Do not show them
# this room.
# this room.
return
return
...
...
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