diff options
author | mathieui <mathieui@mathieui.net> | 2022-04-08 19:22:41 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2022-04-08 19:22:41 +0200 |
commit | 4e369910d6719d3759d1c919dad736b5c975dfe4 (patch) | |
tree | fb490465d489c53a106389af99f473f99f914d98 /plugins | |
parent | 980ba4ef553f05cd52243e787946f94f47aaa017 (diff) | |
download | poezio-4e369910d6719d3759d1c919dad736b5c975dfe4.tar.gz poezio-4e369910d6719d3759d1c919dad736b5c975dfe4.tar.bz2 poezio-4e369910d6719d3759d1c919dad736b5c975dfe4.tar.xz poezio-4e369910d6719d3759d1c919dad736b5c975dfe4.zip |
fix: irc plugin defaults
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/irc.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/irc.py b/plugins/irc.py index 0fb41af0..f3aa7b63 100644 --- a/plugins/irc.py +++ b/plugins/irc.py @@ -122,6 +122,13 @@ from poezio import tabs class Plugin(BasePlugin): + default_config = { + 'irc': { + "initial_connect": True, + "gateway": "irc.jabberfr.org", + } + } + def init(self) -> None: if self.config.getbool('initial_connect'): asyncio.create_task( @@ -167,7 +174,7 @@ class Plugin(BasePlugin): await asyncio.gather(*joins) async def initial_connect(self) -> None: - gateway: str = self.config.getstr('gateway') or 'irc.jabberfr.org' + gateway: str = self.config.getstr('gateway') sections: List[str] = self.config.sections() sections_jid = [] @@ -246,7 +253,7 @@ class Plugin(BasePlugin): Join all the rooms configured for a section (section = irc server) """ - gateway: str = self.config.getstr('gateway') or 'irc.jabberfr.org' + gateway: str = self.config.getstr('gateway') rooms: List[str] = self.config.get_by_tabname('rooms', section).split(':') nick: str = self.config.get_by_tabname('nickname', section) if nick: @@ -283,7 +290,7 @@ class Plugin(BasePlugin): current tab. If the current tab is not an IRC channel or private conversation, a warning is displayed and None is returned """ - gateway: str = self.config.getstr('gateway') or 'irc.jabberfr.org' + gateway: str = self.config.getstr('gateway') current = self.api.current_tab() current_jid = current.jid if not current_jid.server == gateway: |