1 ;;; riece-ignore.el --- ignore user
2 ;; Copyright (C) 1998-2004 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.
27 ;; To use, add the following line to your ~/.riece/init.el:
28 ;; (add-to-list 'riece-addons 'riece-ignore)
32 (require 'riece-signal)
33 (require 'riece-identity)
34 (require 'riece-message)
36 (defvar riece-ignored-user nil)
38 (defun riece-ignore-by-user (user)
40 (let ((completion-ignore-case t))
41 (list (riece-completing-read-identity
43 (riece-get-users-on-server (riece-current-server-name))))))
44 (setq riece-ignored-user (cons user riece-ignored-user))
47 (lambda (signal handback)
48 (let ((pointer (riece-identity-member (car (riece-signal-args signal))
51 (setcar pointer (nth 1 (riece-signal-args signal))))))))
53 (defun riece-ignore-message-filter (message)
54 (unless (riece-identity-member (riece-message-speaker message)
58 (defvar riece-command-mode-map)
59 (defun riece-ignore-insinuate ()
60 (add-hook 'riece-message-filter-functions 'riece-ignore-message-filter)
61 (define-key riece-command-mode-map
62 "\C-ck" 'riece-ignore-by-user))
64 (provide 'riece-ignore)
66 ;;; riece-ignore.el ends here