diff 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
line wrap: on
line diff
--- a/mcabber/contrib/eventcmd	Sun Nov 20 00:08:49 2005 +0100
+++ b/mcabber/contrib/eventcmd	Sun Nov 20 00:12:53 2005 +0100
@@ -15,15 +15,26 @@
 event=$1
 arg1=$2
 arg2=$3
+filename=$4
+# Note that the 4th argument is only provided for incoming messages
+# and when 'event_log_files' is set.
 
 if [ $event == "MSG" ]; then
   case "$arg1" in
     IN)
       # Incoming message from buddy $arg2
       $CMD_MSG_IN > /dev/null 2>&1
+      if [[ -n "$filename" && -f "$filename" ]]; then
+        # We could process filename here...
+        /bin/rm $filename
+      fi
       ;;
     MUC)
       # Groupchat message in room $arg2
+      if [[ -n "$filename" && -f "$filename" ]]; then
+        # We could process filename here...
+        /bin/rm $filename
+      fi
       ;;
     OUT)
       # Outgoing message for buddy $arg2