globster-pmnotify

This script is supposed to notify hub operators about incomming private message. It is easy to configure and use. Configuration is saved in XML format and allows opchat or individual notifications.

Dependency

Installation and usage

Download the script and move it to any location on your filesystem. Then create config XML file and save it in the same directory as globster-pmnotify.xml, you can use the example configuration at the bottom of this document.

To start the script:

cd /path/to/script
./globster-pmnotify.pl [<config>]

If no config file is given, the script searches for globster-pmnotify.xml in the script path or /etc/globster. We changed the directory to the script path and we have the config in the same directory so we can leave this argument empty.

To run in background:

./globster-pmnotify.pl &

XML configuration

The table below shows tags allowed in the XML configuration file.

TagDescriptionContainer tag
configStart tag of the configuration, can be replaced by any tag except other tags described here.-
hubNew hub object.config
messageNotification text. Use %[userNI] and %[message] for info about sender and text of the private message.hub
responseResponse to the sender. Should inform about the request redirection.hub
optoutNickname opted out from notifications. Only useful if destination is set to 0 (see below). Specified nickname is not notified about incomming private messages, but still private messages from this nickname are accepted. Multiple usage of this tag is allowed.hub
ignoredIgnored nickname. Bot does not accept messages from this user and does not send any reply or notification bakwards. Useful to exclude known bots, jokers or pm flooders. Multiple usage of this tag is allowed.hub
opchatOpchat nickname notified if destination (see below) is set to 1. This is special case of ignored (see above) nickname. Opchat is notified, but messages from this nickname are not accepted. Specify this value if destination is set to 0 if there is a opchat user among operators.hub

The table below shows attributes allowed in the XML configuration file.

AttributeDescriptionTag
dbusaddrDBUS_SESSION_BUS_ADDRESS of the Globster bus session. Script uses this address to identify the session of Globster in case of script restart. This attribute is optional.config
hubidGlobster hub id to link.hub
stateInitial state of the notifier (0 off, 1 on).hub
destinationSet to 1 notifies opchat, 0 notifies operators individualy. Although setting to 0 is more picky about users notified when optout and ignored tags are used, it may be also recognized by hub as pm flooding and lose notifications or replies. Therefore timeout should be set (see below).hub
timeoutSleep time in seconds between replies and notifications. Should be set to a higher value than chat flood limit on hub. Number from interval between 1 to 10 should suffice on sane hub/hubsoft. Setting to very high value makes notifications slow too much. E.g. timeout 20 takes 1 minute (60 seconds) to notify 3 operators.hub

Example configuration

Sample configuration can be found here.