Source

erc / erc-netsplit.el

Diff from to

File erc-netsplit.el

 (define-erc-module netsplit nil
   "This mode hides quit/join messages if a netsplit occurs."
   ((erc-netsplit-install-message-catalogs)
-   (add-hook 'erc-server-JOIN-hook 'erc-netsplit-JOIN)
-   (add-hook 'erc-server-MODE-hook 'erc-netsplit-MODE)
-   (add-hook 'erc-server-QUIT-hook 'erc-netsplit-QUIT)
+   (add-hook 'erc-server-JOIN-functions 'erc-netsplit-JOIN)
+   (add-hook 'erc-server-MODE-functions 'erc-netsplit-MODE)
+   (add-hook 'erc-server-QUIT-functions 'erc-netsplit-QUIT)
    (add-hook 'erc-timer-hook 'erc-netsplit-timer))
-  ((remove-hook 'erc-server-JOIN-hook 'erc-netsplit-JOIN)
-   (remove-hook 'erc-server-MODE-hook 'erc-netsplit-MODE)
-   (remove-hook 'erc-server-QUIT-hook 'erc-netsplit-QUIT)
+  ((remove-hook 'erc-server-JOIN-functions 'erc-netsplit-JOIN)
+   (remove-hook 'erc-server-MODE-functions 'erc-netsplit-MODE)
+   (remove-hook 'erc-server-QUIT-functions 'erc-netsplit-QUIT)
    (remove-hook 'erc-timer-hook 'erc-netsplit-timer)))
 
 (defcustom erc-netsplit-show-server-mode-changes-flag nil
 
 (defun erc-netsplit-JOIN (proc parsed)
   "Show/don't show rejoins."
-  (let ((nick (aref parsed 1))
+  (let ((nick (erc-response.sender parsed))
 	(no-next-hook nil))
     (dolist (elt erc-netsplit-list)
       (if (member nick (nthcdr 3 elt))
 (defun erc-netsplit-MODE (proc parsed)
   "Hide mode changes from servers."
   ;; regexp matches things with a . in them, and no ! or @ in them.
-  (when (string-match "^[^@!]+\\.[^@!]+$" (aref parsed 1))
+  (when (string-match "^[^@!]+\\.[^@!]+$" (erc-response.sender parsed))
     (and erc-netsplit-debug
 	 (erc-display-message 
 	  parsed 'notice (process-buffer proc)
 
 (defun erc-netsplit-QUIT (proc parsed)
   "Detect netsplits."
-  (let ((split (aref parsed 2))
-	(nick (aref parsed 1))
+  (let ((split (erc-response.contents parsed))
+	(nick (erc-response.sender parsed))
 	ass)
     (when (string-match erc-netsplit-regexp split)
       (setq ass (assoc split erc-netsplit-list))