From 9ae2f17091ee3209187538ca483c74946ec47430 Mon Sep 17 00:00:00 2001 From: "Schimon Jehudah, Adv." Date: Fri, 31 May 2024 12:37:53 +0300 Subject: [PATCH] Segregate XMPP (Jabber) client module. --- bukubot/__main__.py | 6 ------ bukubot/xmpp/client.py | 3 +++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/bukubot/__main__.py b/bukubot/__main__.py index 238772b..60e85a9 100644 --- a/bukubot/__main__.py +++ b/bukubot/__main__.py @@ -22,9 +22,6 @@ import sys # bookmarks_db.search_keywords_and_filter_by_tags # bookmarks_db.exclude_results_from_search - - - def main(): # Setup the command line arguments. parser = ArgumentParser(description=Client.__doc__) @@ -58,9 +55,6 @@ def main(): # have interdependencies, the order in which you register them does # not matter. xmpp = Client(args.jid, args.password) - xmpp.connect() - xmpp.process() - if __name__ == '__main__': main() diff --git a/bukubot/xmpp/client.py b/bukubot/xmpp/client.py index f704dbb..05c42be 100644 --- a/bukubot/xmpp/client.py +++ b/bukubot/xmpp/client.py @@ -63,6 +63,9 @@ class Client(slixmpp.ClientXMPP): self.add_event_handler("message", self.process_message) self.add_event_handler("disco_info", self.process_disco_info) + self.connect() + self.process() + async def process_session_start(self, event): """ Process the session_start event.