Segregate XMPP (Jabber) client module.

This commit is contained in:
Schimon Jehudah, Adv. 2024-05-31 12:37:53 +03:00
parent 440da124c0
commit 9ae2f17091
2 changed files with 3 additions and 6 deletions

View file

@ -22,9 +22,6 @@ import sys
# bookmarks_db.search_keywords_and_filter_by_tags # bookmarks_db.search_keywords_and_filter_by_tags
# bookmarks_db.exclude_results_from_search # bookmarks_db.exclude_results_from_search
def main(): def main():
# Setup the command line arguments. # Setup the command line arguments.
parser = ArgumentParser(description=Client.__doc__) parser = ArgumentParser(description=Client.__doc__)
@ -58,9 +55,6 @@ def main():
# have interdependencies, the order in which you register them does # have interdependencies, the order in which you register them does
# not matter. # not matter.
xmpp = Client(args.jid, args.password) xmpp = Client(args.jid, args.password)
xmpp.connect()
xmpp.process()
if __name__ == '__main__': if __name__ == '__main__':
main() main()

View file

@ -63,6 +63,9 @@ class Client(slixmpp.ClientXMPP):
self.add_event_handler("message", self.process_message) self.add_event_handler("message", self.process_message)
self.add_event_handler("disco_info", self.process_disco_info) self.add_event_handler("disco_info", self.process_disco_info)
self.connect()
self.process()
async def process_session_start(self, event): async def process_session_start(self, event):
""" """
Process the session_start event. Process the session_start event.