annotate mcabber/contrib/eventcmd @ 830:80434fde7cfa

Display presence notification timestamps when they exist These timestamps were used in the roster, but not in the buffer window message nor in the history logfile. Reported by "ze".
author Mikael Berthe <mikael@lilotux.net>
date Wed, 03 May 2006 11:28:41 +0200
parents c7f94f6e51f0
children 76c03fafabd3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
316
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
1 #! /bin/sh
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
2 #
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
3 # Sample events script for mcabber
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
4 # Plays a sound when receiving a message
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
5 #
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
6 # To use this script, set the "events_command" option to the path of
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
7 # the script (see the mcabberrc.example file for an example)
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
8 #
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
9 # MiKael, 2005-07-15
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
10
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
11 # The following sound comes with the gtkboard package,
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
12 # you can modify this line to play another one...
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
13 CMD_MSG_IN="/usr/bin/play /usr/share/sounds/gtkboard/machine_move.ogg"
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
14
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
15 event=$1
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
16 arg1=$2
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
17 arg2=$3
525
c7f94f6e51f0 Update sample mcabberrc and eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents: 457
diff changeset
18 filename=$4
c7f94f6e51f0 Update sample mcabberrc and eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents: 457
diff changeset
19 # Note that the 4th argument is only provided for incoming messages
c7f94f6e51f0 Update sample mcabberrc and eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents: 457
diff changeset
20 # and when 'event_log_files' is set.
316
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
21
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
22 if [ $event == "MSG" ]; then
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
23 case "$arg1" in
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
24 IN)
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
25 # Incoming message from buddy $arg2
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
26 $CMD_MSG_IN > /dev/null 2>&1
525
c7f94f6e51f0 Update sample mcabberrc and eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents: 457
diff changeset
27 if [[ -n "$filename" && -f "$filename" ]]; then
c7f94f6e51f0 Update sample mcabberrc and eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents: 457
diff changeset
28 # We could process filename here...
c7f94f6e51f0 Update sample mcabberrc and eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents: 457
diff changeset
29 /bin/rm $filename
c7f94f6e51f0 Update sample mcabberrc and eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents: 457
diff changeset
30 fi
316
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
31 ;;
457
2fd528c49173 Add MUC message type in sample eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents: 355
diff changeset
32 MUC)
2fd528c49173 Add MUC message type in sample eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents: 355
diff changeset
33 # Groupchat message in room $arg2
525
c7f94f6e51f0 Update sample mcabberrc and eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents: 457
diff changeset
34 if [[ -n "$filename" && -f "$filename" ]]; then
c7f94f6e51f0 Update sample mcabberrc and eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents: 457
diff changeset
35 # We could process filename here...
c7f94f6e51f0 Update sample mcabberrc and eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents: 457
diff changeset
36 /bin/rm $filename
c7f94f6e51f0 Update sample mcabberrc and eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents: 457
diff changeset
37 fi
457
2fd528c49173 Add MUC message type in sample eventcmd script
Mikael Berthe <mikael@lilotux.net>
parents: 355
diff changeset
38 ;;
316
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
39 OUT)
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
40 # Outgoing message for buddy $arg2
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
41 ;;
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
42 esac
355
c5a7a7273986 Add some external actions
Mikael Berthe <mikael@lilotux.net>
parents: 316
diff changeset
43 elif [ $event == "STATUS" ]; then
c5a7a7273986 Add some external actions
Mikael Berthe <mikael@lilotux.net>
parents: 316
diff changeset
44 # Buddy $arg2 status is $arg1 (_, O, I, F, D, N, A)
c5a7a7273986 Add some external actions
Mikael Berthe <mikael@lilotux.net>
parents: 316
diff changeset
45 echo > /dev/null
316
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
46 fi
e315566f09b0 Add a sample script for the events command
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
47