Add a new plugin - lammoth/Gesuser GitHub Wiki

When you want add a new agent to the system, should make the following steps:

Agent plugin

To add a new agent, you should make:

interfaces: gagent.py

  • _create_event_handlers method: This method handler a specific stanza. You should handle the custom agent stanza here
  • check_mods method: This method is responsible of modules load. You must define the operations for your module here

actions: module_name_actions.py

This file contains the specific methods to work with a custom stanza of the module. To work fine you should use the SleekXMPP method register_stanza_plugin

common: customstanzahandler.py

This file manages petitions of the module. It sends a message to the client.

mods: mod_module_name.py

This file contains the module operations. This operations are executed by module_name_actions.py on request by the user This file must contains a method called isActive, and in the constructor must have a parameter wwith the name of the module by the following way:

  • self.name = MOD_MODULE_NAME

Client plugin

To add a new module to the client, you should make:

###common: menu.php

In this file you must add a new section with the name of the new module

<li class="inactive" id="module-user"><a class="main_menu" href="user">Users</a></li>

###php:module_name:submenu.php In this file you must add as many sections as the module operations

###js:module_name:module_name.js In this file you must add the operations of the module, usually AJAX operations A good practice is follow the following structure:

  • Create a object called MODULE_NAME_GUI: This object contains GUI data.
  • Create a object called module_nameOperations: This object contains all methods of the module.
  • At the end of file should add the default processes of the module (Bubble messages, etc)

###css:module_name:module_name.css In this file you must add the style of the module interface, you should precede the elements with the name of the module

###img:module_name In this dir you must add the images of the module

⚠️ **GitHub.com Fallback** ⚠️