mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-12 18:22:10 -04:00
Remove underscore from SQLBaseStore functions
This commit is contained in:
parent
c2f525a525
commit
ee86abb2d6
56 changed files with 550 additions and 558 deletions
|
@ -53,7 +53,7 @@ class RoomWorkerStore(SQLBaseStore):
|
|||
Returns:
|
||||
A dict containing the room information, or None if the room is unknown.
|
||||
"""
|
||||
return self._simple_select_one(
|
||||
return self.simple_select_one(
|
||||
table="rooms",
|
||||
keyvalues={"room_id": room_id},
|
||||
retcols=("room_id", "is_public", "creator"),
|
||||
|
@ -62,7 +62,7 @@ class RoomWorkerStore(SQLBaseStore):
|
|||
)
|
||||
|
||||
def get_public_room_ids(self):
|
||||
return self._simple_select_onecol(
|
||||
return self.simple_select_onecol(
|
||||
table="rooms",
|
||||
keyvalues={"is_public": True},
|
||||
retcol="room_id",
|
||||
|
@ -266,7 +266,7 @@ class RoomWorkerStore(SQLBaseStore):
|
|||
|
||||
@cached(max_entries=10000)
|
||||
def is_room_blocked(self, room_id):
|
||||
return self._simple_select_one_onecol(
|
||||
return self.simple_select_one_onecol(
|
||||
table="blocked_rooms",
|
||||
keyvalues={"room_id": room_id},
|
||||
retcol="1",
|
||||
|
@ -287,7 +287,7 @@ class RoomWorkerStore(SQLBaseStore):
|
|||
of RatelimitOverride are None or 0 then ratelimitng has been
|
||||
disabled for that user entirely.
|
||||
"""
|
||||
row = yield self._simple_select_one(
|
||||
row = yield self.simple_select_one(
|
||||
table="ratelimit_override",
|
||||
keyvalues={"user_id": user_id},
|
||||
retcols=("messages_per_second", "burst_count"),
|
||||
|
@ -407,7 +407,7 @@ class RoomStore(RoomWorkerStore, SearchStore):
|
|||
ev = json.loads(row["json"])
|
||||
retention_policy = json.dumps(ev["content"])
|
||||
|
||||
self._simple_insert_txn(
|
||||
self.simple_insert_txn(
|
||||
txn=txn,
|
||||
table="room_retention",
|
||||
values={
|
||||
|
@ -453,7 +453,7 @@ class RoomStore(RoomWorkerStore, SearchStore):
|
|||
try:
|
||||
|
||||
def store_room_txn(txn, next_id):
|
||||
self._simple_insert_txn(
|
||||
self.simple_insert_txn(
|
||||
txn,
|
||||
"rooms",
|
||||
{
|
||||
|
@ -463,7 +463,7 @@ class RoomStore(RoomWorkerStore, SearchStore):
|
|||
},
|
||||
)
|
||||
if is_public:
|
||||
self._simple_insert_txn(
|
||||
self.simple_insert_txn(
|
||||
txn,
|
||||
table="public_room_list_stream",
|
||||
values={
|
||||
|
@ -482,14 +482,14 @@ class RoomStore(RoomWorkerStore, SearchStore):
|
|||
@defer.inlineCallbacks
|
||||
def set_room_is_public(self, room_id, is_public):
|
||||
def set_room_is_public_txn(txn, next_id):
|
||||
self._simple_update_one_txn(
|
||||
self.simple_update_one_txn(
|
||||
txn,
|
||||
table="rooms",
|
||||
keyvalues={"room_id": room_id},
|
||||
updatevalues={"is_public": is_public},
|
||||
)
|
||||
|
||||
entries = self._simple_select_list_txn(
|
||||
entries = self.simple_select_list_txn(
|
||||
txn,
|
||||
table="public_room_list_stream",
|
||||
keyvalues={
|
||||
|
@ -507,7 +507,7 @@ class RoomStore(RoomWorkerStore, SearchStore):
|
|||
add_to_stream = bool(entries[-1]["visibility"]) != is_public
|
||||
|
||||
if add_to_stream:
|
||||
self._simple_insert_txn(
|
||||
self.simple_insert_txn(
|
||||
txn,
|
||||
table="public_room_list_stream",
|
||||
values={
|
||||
|
@ -547,7 +547,7 @@ class RoomStore(RoomWorkerStore, SearchStore):
|
|||
def set_room_is_public_appservice_txn(txn, next_id):
|
||||
if is_public:
|
||||
try:
|
||||
self._simple_insert_txn(
|
||||
self.simple_insert_txn(
|
||||
txn,
|
||||
table="appservice_room_list",
|
||||
values={
|
||||
|
@ -560,7 +560,7 @@ class RoomStore(RoomWorkerStore, SearchStore):
|
|||
# We've already inserted, nothing to do.
|
||||
return
|
||||
else:
|
||||
self._simple_delete_txn(
|
||||
self.simple_delete_txn(
|
||||
txn,
|
||||
table="appservice_room_list",
|
||||
keyvalues={
|
||||
|
@ -570,7 +570,7 @@ class RoomStore(RoomWorkerStore, SearchStore):
|
|||
},
|
||||
)
|
||||
|
||||
entries = self._simple_select_list_txn(
|
||||
entries = self.simple_select_list_txn(
|
||||
txn,
|
||||
table="public_room_list_stream",
|
||||
keyvalues={
|
||||
|
@ -588,7 +588,7 @@ class RoomStore(RoomWorkerStore, SearchStore):
|
|||
add_to_stream = bool(entries[-1]["visibility"]) != is_public
|
||||
|
||||
if add_to_stream:
|
||||
self._simple_insert_txn(
|
||||
self.simple_insert_txn(
|
||||
txn,
|
||||
table="public_room_list_stream",
|
||||
values={
|
||||
|
@ -652,7 +652,7 @@ class RoomStore(RoomWorkerStore, SearchStore):
|
|||
# Ignore the event if one of the value isn't an integer.
|
||||
return
|
||||
|
||||
self._simple_insert_txn(
|
||||
self.simple_insert_txn(
|
||||
txn=txn,
|
||||
table="room_retention",
|
||||
values={
|
||||
|
@ -671,7 +671,7 @@ class RoomStore(RoomWorkerStore, SearchStore):
|
|||
self, room_id, event_id, user_id, reason, content, received_ts
|
||||
):
|
||||
next_id = self._event_reports_id_gen.get_next()
|
||||
return self._simple_insert(
|
||||
return self.simple_insert(
|
||||
table="event_reports",
|
||||
values={
|
||||
"id": next_id,
|
||||
|
@ -717,7 +717,7 @@ class RoomStore(RoomWorkerStore, SearchStore):
|
|||
Returns:
|
||||
Deferred
|
||||
"""
|
||||
yield self._simple_upsert(
|
||||
yield self.simple_upsert(
|
||||
table="blocked_rooms",
|
||||
keyvalues={"room_id": room_id},
|
||||
values={},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue