Initial Commit
[packages] / xemacs-packages / liece / lisp / liece-500.el
1 ;;; liece-500.el --- Handler routines for 500 numeric reply.
2 ;; Copyright (C) 1998-2000 Daiki Ueno
3
4 ;; Author: Daiki Ueno <ueno@unixuser.org>
5 ;; Created: 1998-09-28
6 ;; Revised: 1998-11-25
7 ;; Keywords: IRC, liece
8
9 ;; This file is part of Liece.
10
11 ;; This program is free software; you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; any later version.
15
16 ;; This program is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 ;; GNU General Public License for more details.
20
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24 ;; Boston, MA 02111-1307, USA.
25
26
27 ;;; Commentary:
28 ;; 
29
30 ;;; Code:
31
32 (eval-when-compile
33   (require 'liece-inlines)
34   (require 'liece-intl)
35   (require 'liece-misc))
36
37 (defun* liece-handle-500-messages (number prefix rest)
38   (or (string-match "[^ ]* \\([^ :]*\\) *\\([^ :]*\\) *:\\(.*\\)" rest)
39       (return-from liece-handle-500-messages))
40   (let ((target1 (match-string 1 rest)) (target2 (match-string 2 rest))
41         (msg (match-string 3 rest)))
42     (cond ((string-equal target1 "")
43            (liece-insert-error liece-500-buffer (concat msg "\n")))
44           ((string-equal target2 "")
45            (liece-insert-error liece-500-buffer
46                                 (concat msg " (" target1 ")\n")))
47           (t
48            (liece-insert-error liece-500-buffer
49                                 (format "%s %s (%s)\n"
50                                         target1 msg target2))))))
51
52 (provide 'liece-500)
53
54 ;;; liece-500.el ends here