Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit fcfe994

Browse files
committed
Switch to using unstable prefixes
1 parent a184fb1 commit fcfe994

File tree

1 file changed

+6
-5
lines changed
  • synapse/storage/databases/main

1 file changed

+6
-5
lines changed

synapse/storage/databases/main/room.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@
1313
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
16-
1716
import collections
1817
import logging
1918
import re
2019
from abc import abstractmethod
2120
from enum import Enum
2221
from typing import Any, Dict, List, Optional, Tuple
2322

24-
from synapse.api.constants import EventTypes
23+
from synapse.api.constants import EventTypes, JoinRules
2524
from synapse.api.errors import StoreError
2625
from synapse.api.room_versions import RoomVersion, RoomVersions
2726
from synapse.storage._base import SQLBaseStore, db_to_json
@@ -178,12 +177,13 @@ def _count_public_rooms_txn(txn):
178177
INNER JOIN room_stats_current USING (room_id)
179178
WHERE
180179
(
181-
join_rules = 'public' OR join_rules = 'knock'
180+
join_rules = 'public' OR join_rules = '%(knock_join_rule)s'
182181
OR history_visibility = 'world_readable'
183182
)
184183
AND joined_members > 0
185184
""" % {
186-
"published_sql": published_sql
185+
"published_sql": published_sql,
186+
"knock_join_rule": JoinRules.KNOCK,
187187
}
188188

189189
txn.execute(sql, query_args)
@@ -314,7 +314,7 @@ async def get_largest_public_rooms(
314314
INNER JOIN room_stats_current USING (room_id)
315315
WHERE
316316
(
317-
join_rules = 'public' OR join_rules = 'knock'
317+
join_rules = 'public' OR join_rules = '%(knock_join_rule)s'
318318
OR history_visibility = 'world_readable'
319319
)
320320
AND joined_members > 0
@@ -324,6 +324,7 @@ async def get_largest_public_rooms(
324324
"published_sql": published_sql,
325325
"where_clause": where_clause,
326326
"dir": "DESC" if forwards else "ASC",
327+
"knock_join_rule": JoinRules.KNOCK,
327328
}
328329

329330
if limit is not None:

0 commit comments

Comments
 (0)