slidge.core.command.user#

Commands available to users

Module Contents#

Classes#

Search

Abstract base class to implement gateway commands (chatbot and ad-hoc)

Unregister

Abstract base class to implement gateway commands (chatbot and ad-hoc)

SyncContacts

Abstract base class to implement gateway commands (chatbot and ad-hoc)

ListContacts

Abstract base class to implement gateway commands (chatbot and ad-hoc)

ListGroups

Abstract base class to implement gateway commands (chatbot and ad-hoc)

Login

Abstract base class to implement gateway commands (chatbot and ad-hoc)

class slidge.core.command.user.Search(xmpp)[source]#

Bases: slidge.core.command.base.Command

Abstract base class to implement gateway commands (chatbot and ad-hoc)

Parameters:

xmpp (slidge.core.gateway.BaseGateway) –

NAME = 'Search for contacts'[source]#
HELP = 'Search for contacts via this gateway'[source]#
NODE = 'search'[source]#
CHAT_COMMAND = 'find'[source]#
ACCESS[source]#
async run(session, _ifrom, *args)[source]#

Entry point of the command

Parameters:
  • session – If triggered by a registered user, its slidge Session

  • ifrom – JID of the command-triggering entity

  • args – When triggered via chatbot type message, additional words after the CHAT_COMMAND string was passed

Returns:

Either a TableResult, a Form, a Confirmation, a text, or None

async static search(form_values, session, _ifrom)[source]#
Parameters:
class slidge.core.command.user.Unregister(xmpp)[source]#

Bases: slidge.core.command.base.Command

Abstract base class to implement gateway commands (chatbot and ad-hoc)

Parameters:

xmpp (slidge.core.gateway.BaseGateway) –

NAME = 'Unregister to the gateway'[source]#
HELP = 'Unregister to the gateway'[source]#
ACCESS[source]#
async run(session, _ifrom, *_)[source]#

Entry point of the command

Parameters:
  • session – If triggered by a registered user, its slidge Session

  • ifrom – JID of the command-triggering entity

  • args – When triggered via chatbot type message, additional words after the CHAT_COMMAND string was passed

Returns:

Either a TableResult, a Form, a Confirmation, a text, or None

async unregister(session, _ifrom)[source]#
Parameters:
class slidge.core.command.user.SyncContacts(xmpp)[source]#

Bases: slidge.core.command.base.Command

Abstract base class to implement gateway commands (chatbot and ad-hoc)

Parameters:

xmpp (slidge.core.gateway.BaseGateway) –

NAME = 'Sync XMPP roster'[source]#
HELP = 'Synchronize your XMPP roster with your legacy contacts. Slidge will only add/remove/modify...'[source]#
ACCESS[source]#
async run(session, _ifrom, *_)[source]#

Entry point of the command

Parameters:
  • session – If triggered by a registered user, its slidge Session

  • ifrom – JID of the command-triggering entity

  • args – When triggered via chatbot type message, additional words after the CHAT_COMMAND string was passed

Returns:

Either a TableResult, a Form, a Confirmation, a text, or None

async sync(session, _ifrom)[source]#
Parameters:
class slidge.core.command.user.ListContacts(xmpp)[source]#

Bases: slidge.core.command.base.Command

Abstract base class to implement gateway commands (chatbot and ad-hoc)

Parameters:

xmpp (slidge.core.gateway.BaseGateway) –

ACCESS[source]#
async run(session, _ifrom, *_)[source]#

Entry point of the command

Parameters:
  • session – If triggered by a registered user, its slidge Session

  • ifrom – JID of the command-triggering entity

  • args – When triggered via chatbot type message, additional words after the CHAT_COMMAND string was passed

Returns:

Either a TableResult, a Form, a Confirmation, a text, or None

class slidge.core.command.user.ListGroups(xmpp)[source]#

Bases: slidge.core.command.base.Command

Abstract base class to implement gateway commands (chatbot and ad-hoc)

Parameters:

xmpp (slidge.core.gateway.BaseGateway) –

ACCESS[source]#
async run(session, _ifrom, *_)[source]#

Entry point of the command

Parameters:
  • session – If triggered by a registered user, its slidge Session

  • ifrom – JID of the command-triggering entity

  • args – When triggered via chatbot type message, additional words after the CHAT_COMMAND string was passed

Returns:

Either a TableResult, a Form, a Confirmation, a text, or None

class slidge.core.command.user.Login(xmpp)[source]#

Bases: slidge.core.command.base.Command

Abstract base class to implement gateway commands (chatbot and ad-hoc)

Parameters:

xmpp (slidge.core.gateway.BaseGateway) –

NAME = 'Re-login to the legacy network'[source]#
HELP = 'Login to the legacy service'[source]#
ACCESS[source]#
async run(session, _ifrom, *_)[source]#

Entry point of the command

Parameters:
  • session (Optional[slidge.core.session.BaseSession]) – If triggered by a registered user, its slidge Session

  • ifrom – JID of the command-triggering entity

  • args – When triggered via chatbot type message, additional words after the CHAT_COMMAND string was passed

Returns:

Either a TableResult, a Form, a Confirmation, a text, or None