您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

41 行
1.3 KiB

  1. # Copyright 2018 New Vector Ltd
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. from typing import TYPE_CHECKING
  15. if TYPE_CHECKING:
  16. from synapse.server import HomeServer
  17. class WorkerServerNoticesSender:
  18. """Stub impl of ServerNoticesSender which does nothing"""
  19. def __init__(self, hs: "HomeServer"):
  20. pass
  21. async def on_user_syncing(self, user_id: str) -> None:
  22. """Called when the user performs a sync operation.
  23. Args:
  24. user_id: mxid of user who synced
  25. """
  26. return None
  27. async def on_user_ip(self, user_id: str) -> None:
  28. """Called on the master when a worker process saw a client request.
  29. Args:
  30. user_id: mxid
  31. """
  32. raise AssertionError("on_user_ip unexpectedly called on worker")