Initial Commit
[packages] / xemacs-packages / zenirc / src / zenirc-random-away.el
1 ;;; zenirc-random-away.el
2
3 ;; Copyright (C) 1995 Eric Prestemon
4
5 ;; Author: Eric Prestemon <ecp@io.com>
6 ;; Maintainer: eric@american.edu
7 ;; Keywords: zenirc, extensions
8 ;; Created: 1995-01-04
9
10 ;; This program is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
13 ;; any later version.
14 ;;
15 ;; This program is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 ;; GNU General Public License for more details.
19 ;;
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with this program; if not, you can either send email to this
22 ;; program's maintainer or write to: The Free Software Foundation,
23 ;; Inc.; 675 Massachusetts Avenue; Cambridge, MA 02139, USA.
24
25 ;;; Commentary:
26 ;;; Code:
27
28 (require 'zenirc)
29
30 (defvar zenirc-random-away-strings
31   '("I've felt better, but it cost more."
32     "I want to be the one with the most cake."
33     "Someday you will ache like I ache."
34     "Do you have the time to listen to me whine?"
35     "Neurotic in my head no doubt about it."
36     "Oh what a feeling when we're dancing on the ceiling."
37     "What's so funny about peace, love, and understanding?")
38   "*List of strings to use for /away messages")
39
40 (defun zenirc-random-away (proc parsedmsg)
41   "Change away message to a new thing."
42   (and (not (zenirc-channel-p (aref parsedmsg 2)))
43        (process-send-string proc
44         (concat "AWAY :"
45                 (nth (random (length zenirc-random-away-strings))
46                      zenirc-random-away-strings)
47                 "\n"))))
48
49 (zenirc-add-hook 'zenirc-server-PRIVMSG-hook 'zenirc-random-away t)
50
51 (provide 'zenirc-random-away)
52
53 ;;; zenirc-random-away.el ends here