root/conf.py.example

Revision 27, 251 bytes (checked in by davux, 2 years ago)

Move some stuff from PizzjaComponent? to ForeignClient?:

  • The parsing of incoming IQ. The method comes up with a list of resources to which the IQ should be forwarded, then pass the IQ + the list of resources to PizzjaComponent?.forwardStanzaIn. The latter can be given a list of resources and doesn't have to analyze IQs anymore.
  • The tracking of which resource sent a specific IQ get/set (done in send()).
  • The detection of presence stanzas in order to have the component reflect them to all controllers. Get rid of PizzjaComponent?.clientSend().

Pizzja now uses an SQL database for registrations (fixes #2)

  • New class: SQL. It's a singleton that handles all SQL requests. It uses only SQLite backend for now.
  • Get rid of 'contacts' dict in configuration file, PizzjaComponent?, RegistrationManager?
  • Have RegistrationManager? access the database using the SQL module, and not use lists to keep track of registrations and registerers.

Some small improvements in PizzjaComponent?:

  • Don't import xmpp.client and xmpp.protocol entirely but only needed parts of them
  • Get rid of intermediate 1-line sendPresenceProbe() method.
  • Refactor presence_update() for available/unavailable presence handling.
  • When the 1st controller of a group arrives, don't send it an empty presence: updatePriority computes and sends the right presence information, and reflects it to all controllers (one in this case).
  • Don't bother to clientSend unavailable presence when destroying a client: by definition, there are no controllers left anyway.
Line 
1"""Configuration information."""
2
3max_verbosity = 10
4component = { 'jid': 'name-of-the-component',
5              'password': 'foobar',
6              'server': 'example.tld',
7              'port': 4242,
8            }
9
10db = {'file': 'registrations.db'}
Note: See TracBrowser for help on using the browser.