1 ;;; riece-000.el --- handlers for 000 replies
2 ;; Copyright (C) 1998-2003 Daiki Ueno
4 ;; Author: Daiki Ueno <ueno@unixuser.org>
6 ;; Keywords: IRC, riece
8 ;; This file is part of Riece.
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)
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.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
28 (require 'riece-filter) ;riece-default-handle-message
29 (require 'riece-version)
30 (require 'riece-commands) ;riece-command-join
33 (autoload 'riece-default-handle-numeric-reply "riece-filter"))
34 (defun riece-handle-default-000-message (prefix number name string)
35 (setq riece-nick-accepted 'ok)
36 (riece-default-handle-numeric-reply
37 riece-info-prefix prefix number name string))
39 (defun riece-handle-001-message (prefix number name string)
40 "RPL_WELCOME \"Welcome to the Internet Relay Network <nick>!<user>@<host>\""
41 (if riece-real-server-name
42 (error "Already registered"))
43 (setq riece-real-server-name prefix
44 riece-real-nickname name
45 riece-real-userhost nil)
46 (riece-send-string (format "USERHOST %s\r\n" riece-real-nickname))
48 (list riece-dialogue-buffer riece-others-buffer)
49 (concat (substring string 1) "\n"))
50 (if (equal riece-server-name "")
51 (message "Logging in to IRC server...done")
52 (message "Logging in to %s...done" riece-server-name))
53 (let ((channel-list riece-startup-channel-list))
55 (if (listp (car channel-list))
56 (riece-command-join (riece-parse-identity (car (car channel-list)))
57 (nth 1 (car channel-list)))
58 (riece-command-join (riece-parse-identity (car channel-list))))
59 (setq channel-list (cdr channel-list))))
60 (run-hooks 'riece-after-login-hook))
62 (defun riece-handle-004-message (prefix number name string)
63 "RPL_MYINFO \"<umodes> <chnlmodes>\""
64 (if (string-match "^[^ ]+ +[^ ]+ +\\([^ ]+\\) +" string)
65 (setq riece-supported-user-modes
66 (string-to-list (match-string 1 string))
67 riece-supported-channel-modes
68 (string-to-list (substring string (match-end 0))))
70 (list riece-dialogue-buffer riece-others-buffer)
71 (concat string "\n"))))
75 ;;; riece-000.el ends here