* riece-server.el: Implement flood protection.
[elisp/riece.git] / lisp / riece-globals.el
index a1410a5..6c18318 100644 (file)
 (require 'riece-compat)                        ;riece-make-interval-regexp
 
 ;;; Constants:
-(defconst riece-channel-regexp
+(defconst riece-strict-channel-regexp
   (concat "\\([+&#]\\|!"
          (riece-make-interval-regexp "[A-Z0-9]" 5)
          "\\|!!\\)[^\0\7\r\n ,:]*\\(:[^\0\7\r\n ,:]*\\)?"))
 
-(defconst riece-user-regexp
+(defconst riece-strict-user-regexp
   (concat "[][\\\\`_^{|}A-Za-z]"
          (riece-make-interval-regexp "[][\\\\`_^{|}A-Za-z0-9-]" 0 8)))
 
+(defconst riece-laxed-channel-regexp
+  "[+&#!][^\0\7\r\n ,:]*\\(:[^\0\7\r\n ,:]*\\)?")
+
+(defconst riece-laxed-user-regexp
+  "[][\\\\`_^{|}A-Za-z][][\\\\`_^{|}A-Za-z0-9-]*")
+
+(defvar riece-channel-regexp riece-laxed-channel-regexp)
+(defvar riece-user-regexp riece-laxed-user-regexp)
+
 ;;; Global variables:
 (defvar riece-server-process-alist nil
   "An alist mapping server names to processes.")
@@ -99,6 +108,9 @@ Local to the server buffers.")
 (defvar riece-read-point nil
   "Point at the last input was seen.
 Local to the server buffers.")
+(defvar riece-send-queue nil
+  "Send queue for avoiding client flood.
+Local to the server buffers.")
 (defvar riece-obarray nil
   "Namespace of the IRC world.
 Local to the server buffers.")
@@ -117,6 +129,10 @@ Local to the channel buffers.")
 channel buffer is locked.
 Local to the channel buffers.")
 
+(defvar riece-channel-buffer-window-point nil
+  "Last value of point in window which displayed the channel buffer.
+Local to the channel buffers.")
+
 ;;; Modeline indicators:
 (defvar riece-channel-indicator "None"
   "String displayed on the modeline to indicate the current channel.")