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

Commit

Permalink
Add to tox and fix a few more issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Jul 30, 2020
1 parent dd1fbb2 commit 4a3f15d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions synapse/server_notices/resource_limits_server_notices.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
from typing import List, Tuple
from typing import List, Optional, Tuple

from synapse.api.constants import (
EventTypes,
Expand Down Expand Up @@ -135,7 +135,7 @@ async def _remove_limit_block_notification(
)

async def _apply_limit_block_notification(
self, user_id: str, event_body: str, event_limit_type: str
self, user_id: str, event_body: str, event_limit_type: Optional[str]
) -> None:
"""Utility method to apply limit block notifications in the server
notices room.
Expand Down Expand Up @@ -206,7 +206,7 @@ async def _is_room_currently_blocked(self, room_id: str) -> Tuple[bool, List[str
# The user has yet to join the server notices room
pass

referenced_events = []
referenced_events = [] # type: List[str]
if pinned_state_event is not None:
referenced_events = list(pinned_state_event.content.get("pinned", []))

Expand Down
4 changes: 3 additions & 1 deletion synapse/server_notices/server_notices_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Iterable, Union

from synapse.server_notices.consent_server_notices import ConsentServerNotices
from synapse.server_notices.resource_limits_server_notices import (
ResourceLimitsServerNotices,
Expand All @@ -32,7 +34,7 @@ def __init__(self, hs):
self._server_notices = (
ConsentServerNotices(hs),
ResourceLimitsServerNotices(hs),
)
) # type: Iterable[Union[ConsentServerNotices, ResourceLimitsServerNotices]]

async def on_user_syncing(self, user_id: str) -> None:
"""Called when the user performs a sync operation.
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ commands = mypy \
synapse/push/push_rule_evaluator.py \
synapse/replication \
synapse/rest \
synapse/server_notices \
synapse/spam_checker_api \
synapse/storage/data_stores/main/ui_auth.py \
synapse/storage/database.py \
Expand Down

0 comments on commit 4a3f15d

Please sign in to comment.