Update the type of BasePlugin.xmpp to BaseXMPP. Increase the timeout for join_muc_wait.

This commit is contained in:
jinyu 2024-09-08 12:26:36 +08:00 committed by mathieui
parent e79b98b266
commit df0ecfc142
2 changed files with 4 additions and 4 deletions

View File

@ -12,7 +12,7 @@ import copy
import logging
import threading
from slixmpp.clientxmpp import ClientXMPP
from slixmpp.basexmpp import BaseXMPP
from typing import Any, Dict, Set, ClassVar
@ -274,7 +274,7 @@ class BasePlugin(object):
#: `plugin.config['foo']`.
default_config: ClassVar[Dict[str, Any]] = {}
def __init__(self, xmpp: ClientXMPP, config=None):
def __init__(self, xmpp: BaseXMPP, config=None):
self.xmpp = xmpp
if self.xmpp:
self.api = self.xmpp.api.wrap(self.name)

View File

@ -266,7 +266,7 @@ class XEP_0045(BasePlugin):
seconds: Optional[int] = None,
since: Optional[datetime] = None,
presence_options: Optional[PresenceArgs] = None,
timeout: int = 30) -> JoinResult:
timeout: int = 300) -> JoinResult:
"""
Try to join a MUC and block until we are joined or get an error.
@ -312,7 +312,7 @@ class XEP_0045(BasePlugin):
stanza.send()
return await self._await_join(room, timeout)
async def _await_join(self, room: JID, timeout: int = 30) -> JoinResult:
async def _await_join(self, room: JID, timeout: int = 300) -> JoinResult:
"""Do the heavy lifting for awaiting a MUC join
A muc join, once the join stanza is sent, is: