Skip to content

An ejabberd module to send a post request to an arbitrary url when an ejabberd user is offline and receives a message.

Notifications You must be signed in to change notification settings

sanderhahn/mod_interact

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Purpose:

Forward several types of messages as post requests to an arbitrary url.

mod_offline_post forwards messages that are sent to offline users through a post request to a configurable url mod_available_post sends a post request with information about a user that has become available mod_unavailable_post sends a post request with information about a user that has gone offline

Installing:

  • Run the build.sh script to build *.beam files
  • Copy the *.beam files from the ebin directory to the location where the other modules are for your server
  • Add the configuration shown below to your ejabberd.cfg file, providing the correct values for auth_token, and post_url

Example Configuration:

 {mod_offline_post, [
    {auth_token, "your-secret-token-here"},
    {post_url, "http://localhost:3000/your/custom/url"}
 ]}
 {mod_available_post, [
    {auth_token, "your-secret-token-here"},
    {post_url, "http://localhost:3000/your/custom/url"}
 ]}
 {mod_unavailable_post, [
    {auth_token, "your-secret-token-here"},
    {post_url, "http://localhost:3000/your/custom/url"}
 ]}

Results:

The application running at the post_url will receive a post http request with the following form parameters.

mod_offline_post
"to"=>"adam2@localhost"
"from"=>"adam1"
"body"=>"Does it still work?"
"access_token"=>"your-secret-token-here"

mod_available_post
"jabber_id"=>"adam2"
"access_token"=>"your-secret-token-here"

mod_unavailable_post
"jabber_id"=>"adam2"
"access_token"=>"your-secret-token-here"

License

The modules herein are almost entirely based on mod_offline_prowl written by Robert George rgeorge@midnightweb.net They retain the original author's license.

The original post about mod_offline_prowl can be found here

About

An ejabberd module to send a post request to an arbitrary url when an ejabberd user is offline and receives a message.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published