Giter VIP home page Giter VIP logo

ejabberd-module-hello-world's Introduction

Hello World Ejabberd Module

This project demonstrates common techniques used in a custom ejabberd module:

  • Subscribing to/ handling events:
    • Subscribe to friend requests (presence subscriptions)
  • Call other modules to retrieve information about user
    • Retrieve user's friends list
  • Pass configuration parameters into module

Requirements

  • Ejabberd (tested with v18.01)
  • Erlang

Installation

Directory

Create a sym link to this project in your $HOME/.ejabberd-modules/sources folder

Important files

Ejabberd requires the following files:

  • a .spec file in the module folder root
  • a README.txt file (YES, i'm serious)
  • a COPYING file ... sigh

Module Check (optional)

Run a module check to have the module be checked by ejabberd for validity

$ ejabberdctl module_check mod_helloworld

Install module

You must first install a module to ejabberd before it can be used

$ ejabberdctl module_install mod_helloworld

Note:

  • You must run a module_uninstall and then module_install if you make changes to the code
  • You will receive errors if you try including the config of the module in ejabberd.yml before installing it

Update ejabberd.yml

This module demonstrates the passing of config params into a module.

Regardless of whether your module takes config params or not, you will need to update the ejabberd.yml to include your module

The ejabberd config can be found in $EJABBER_HOME/etc/ejabberd/ejabberd.yml

See the conf/mod_helloworld.yml.example for the structure of the config.

Edit the modules section of the ejabberd.yml

modules:
  mod_helloworld:
    url: "http://test.com"

ejabberd-module-hello-world's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.