slidge.plugins.whatsapp.gateway
#
Module Contents#
Classes#
Must be subclassed by a plugin to set up various aspects of the XMPP |
Functions#
|
Log given message of specified level in system-wide logger. |
Attributes#
- slidge.plugins.whatsapp.gateway.REGISTRATION_INSTRUCTIONS = 'Continue and scan the resulting QR codes on your main device to complete registration. More...'[source]#
- slidge.plugins.whatsapp.gateway.WELCOME_MESSAGE = 'Thank you for registering! Please scan the following QR code on your main device to complete...'[source]#
- class slidge.plugins.whatsapp.gateway.Gateway[source]#
Bases:
slidge.BaseGateway
Must be subclassed by a plugin to set up various aspects of the XMPP component behaviour, such as its display name or its registration process.
On slidge launch, a singleton is instantiated, and it will be made available to public classes such
LegacyContact
orBaseSession
as the.xmpp
attribute. Since it inherits fromslixmpp.componentxmpp.ComponentXMPP
, this gives you a hand on low-level XMPP interactions via slixmpp plugins, e.g.:self.send_presence( pfrom="somebody@component.example.com", pto="someonwelse@anotherexample.com", )
However, you should not need to do so often since the classes of the plugin API provides higher level abstractions around most commonly needed use-cases, such as sending messages, or displaying a custom status.
- async unregister(user)[source]#
Optionally override this if you need to clean additional stuff after a user has been removed from the permanent user_store.
You may need to manually logout the legacy session in here,
Session.logout()
will not be called automatically.- Parameters:
user (slidge.GatewayUser) –