comparison mcabber/contrib/eventcmd @ 525:c7f94f6e51f0

Update sample mcabberrc and eventcmd script
author Mikael Berthe <mikael@lilotux.net>
date Sun, 20 Nov 2005 00:12:53 +0100
parents 2fd528c49173
children 76c03fafabd3
comparison
equal deleted inserted replaced
524:05c0e55c4bb1 525:c7f94f6e51f0
13 CMD_MSG_IN="/usr/bin/play /usr/share/sounds/gtkboard/machine_move.ogg" 13 CMD_MSG_IN="/usr/bin/play /usr/share/sounds/gtkboard/machine_move.ogg"
14 14
15 event=$1 15 event=$1
16 arg1=$2 16 arg1=$2
17 arg2=$3 17 arg2=$3
18 filename=$4
19 # Note that the 4th argument is only provided for incoming messages
20 # and when 'event_log_files' is set.
18 21
19 if [ $event == "MSG" ]; then 22 if [ $event == "MSG" ]; then
20 case "$arg1" in 23 case "$arg1" in
21 IN) 24 IN)
22 # Incoming message from buddy $arg2 25 # Incoming message from buddy $arg2
23 $CMD_MSG_IN > /dev/null 2>&1 26 $CMD_MSG_IN > /dev/null 2>&1
27 if [[ -n "$filename" && -f "$filename" ]]; then
28 # We could process filename here...
29 /bin/rm $filename
30 fi
24 ;; 31 ;;
25 MUC) 32 MUC)
26 # Groupchat message in room $arg2 33 # Groupchat message in room $arg2
34 if [[ -n "$filename" && -f "$filename" ]]; then
35 # We could process filename here...
36 /bin/rm $filename
37 fi
27 ;; 38 ;;
28 OUT) 39 OUT)
29 # Outgoing message for buddy $arg2 40 # Outgoing message for buddy $arg2
30 ;; 41 ;;
31 esac 42 esac