comparison libervia/backend/plugins/plugin_xep_0384.py @ 4072:040095a5dc7f

refactoring: rename `SAT` class to `LiberviaBackend`
author Goffi <goffi@goffi.org>
date Fri, 02 Jun 2023 11:55:48 +0200
parents 4b842c1fb686
children 7c5654c54fed
comparison
equal deleted inserted replaced
4071:4b842c1fb686 4072:040095a5dc7f
34 from libervia.backend.core import exceptions 34 from libervia.backend.core import exceptions
35 from libervia.backend.core.constants import Const as C 35 from libervia.backend.core.constants import Const as C
36 from libervia.backend.core.core_types import MessageData, SatXMPPEntity 36 from libervia.backend.core.core_types import MessageData, SatXMPPEntity
37 from libervia.backend.core.i18n import _, D_ 37 from libervia.backend.core.i18n import _, D_
38 from libervia.backend.core.log import getLogger, Logger 38 from libervia.backend.core.log import getLogger, Logger
39 from libervia.backend.core.sat_main import SAT 39 from libervia.backend.core.sat_main import LiberviaBackend
40 from libervia.backend.core.xmpp import SatXMPPClient 40 from libervia.backend.core.xmpp import SatXMPPClient
41 from libervia.backend.memory import persistent 41 from libervia.backend.memory import persistent
42 from libervia.backend.plugins.plugin_misc_text_commands import TextCommands 42 from libervia.backend.plugins.plugin_misc_text_commands import TextCommands
43 from libervia.backend.plugins.plugin_xep_0045 import XEP_0045 43 from libervia.backend.plugins.plugin_xep_0045 import XEP_0045
44 from libervia.backend.plugins.plugin_xep_0060 import XEP_0060 44 from libervia.backend.plugins.plugin_xep_0060 import XEP_0060
801 )) 801 ))
802 802
803 await client.a_send(message_data["xml"]) 803 await client.a_send(message_data["xml"])
804 804
805 805
806 def make_session_manager(sat: SAT, profile: str) -> Type[omemo.SessionManager]: 806 def make_session_manager(sat: LiberviaBackend, profile: str) -> Type[omemo.SessionManager]:
807 """ 807 """
808 @param sat: The SAT instance. 808 @param sat: The SAT instance.
809 @param profile: The profile. 809 @param profile: The profile.
810 @return: A non-abstract subclass of :class:`~omemo.session_manager.SessionManager` 810 @return: A non-abstract subclass of :class:`~omemo.session_manager.SessionManager`
811 with XMPP interactions and trust handled via the SAT instance. 811 with XMPP interactions and trust handled via the SAT instance.
1387 1387
1388 return SessionManagerImpl 1388 return SessionManagerImpl
1389 1389
1390 1390
1391 async def prepare_for_profile( 1391 async def prepare_for_profile(
1392 sat: SAT, 1392 sat: LiberviaBackend,
1393 profile: str, 1393 profile: str,
1394 initial_own_label: Optional[str], 1394 initial_own_label: Optional[str],
1395 signed_pre_key_rotation_period: int = 7 * 24 * 60 * 60, 1395 signed_pre_key_rotation_period: int = 7 * 24 * 60 * 60,
1396 pre_key_refill_threshold: int = 99, 1396 pre_key_refill_threshold: int = 99,
1397 max_num_per_session_skipped_keys: int = 1000, 1397 max_num_per_session_skipped_keys: int = 1000,
1538 to_policy=SCEAffixPolicy.OPTIONAL, 1538 to_policy=SCEAffixPolicy.OPTIONAL,
1539 from_policy=SCEAffixPolicy.OPTIONAL, 1539 from_policy=SCEAffixPolicy.OPTIONAL,
1540 custom_policies={} 1540 custom_policies={}
1541 ) 1541 )
1542 1542
1543 def __init__(self, sat: SAT) -> None: 1543 def __init__(self, sat: LiberviaBackend) -> None:
1544 """ 1544 """
1545 @param sat: The SAT instance. 1545 @param sat: The SAT instance.
1546 """ 1546 """
1547 1547
1548 self.__sat = sat 1548 self.__sat = sat