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.
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 &
The table below shows tags allowed in the XML configuration file.
Tag | Description | Container tag |
---|---|---|
config | Start tag of the configuration, can be replaced by any tag except other tags described here. | - |
hub | New hub object. | config |
message | Notification text. Use %[userNI] and %[message] for info about sender and text of the private message. | hub |
response | Response to the sender. Should inform about the request redirection. | hub |
optout | Nickname 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 |
ignored | Ignored 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 |
opchat | Opchat 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.
Attribute | Description | Tag |
---|---|---|
dbusaddr | DBUS_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 |
hubid | Globster hub id to link. | hub |
state | Initial state of the notifier (0 off, 1 on). | hub |
destination | Set 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 |
timeout | Sleep 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 |
Sample configuration can be found here.