[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Erbot-cvs] Changes to erbot/erbot.el
From: |
D . Goel |
Subject: |
[Erbot-cvs] Changes to erbot/erbot.el |
Date: |
Thu, 10 Nov 2005 00:59:17 -0500 |
Index: erbot/erbot.el
diff -u erbot/erbot.el:1.43 erbot/erbot.el:1.44
--- erbot/erbot.el:1.43 Thu Nov 10 04:32:48 2005
+++ erbot/erbot.el Thu Nov 10 05:59:16 2005
@@ -1,5 +1,5 @@
;;; erbot.el --- Another robot for ERC.
-;; Time-stamp: <2005-10-05 20:30:09 deego>
+;; Time-stamp: <2005-11-10 00:54:37 deego>
;; Emacs Lisp Archive entry
;; Filename: erbot.el
;; Package: erbot
@@ -837,17 +837,24 @@
(defun erbot-safep (reply)
+ "Determine whether a reply is safe. Any newlines are simply
+reported as unsafe.
- (or
- (string-match "^[0-9a-zA-Z]" reply)
- ;;(not (string-match "^/" reply)) -- this is bad.. since, control
- ;;characters are bad... beginnning ^A for example, will send CTCP requests..
-
- ;; Allow /me commands.. but only when the rest of the text has no
- ;; control characters..
- (and (equal 0 (string-match "^/me " reply))
- (let ((rlist (string-to-list reply)))
- (not (member-if (lambda (a) (< a 32)) rlist))))))
+If this functions deems a reply as unsafe, you should not send it to
+ERC. If an unsafe reply has no newlines, it may be rendered safe by
+appending a space in front of the reply."
+ (and
+ (not (string-match "\n\r" reply))
+ (or
+ (string-match "^[0-9a-zA-Z]" reply)
+ ;;(not (string-match "^/" reply)) -- this is bad.. since, control
+ ;;characters are bad... beginnning ^A for example, will send CTCP
requests..
+
+ ;; Allow /me commands.. but only when the rest of the text has no
+ ;; control characters..
+ (and (equal 0 (string-match "^/me " reply))
+ (let ((rlist (string-to-list reply)))
+ (not (member-if (lambda (a) (< a 32)) rlist)))))))