diff options
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/net/rcirc.el | 19 |
2 files changed, 20 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 101ea1d20bb..4e0dc57c1b7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2011-02-09 Deniz Dogan <deniz.a.m.dogan@gmail.com> | ||
| 2 | |||
| 3 | * net/rcirc.el (rcirc-cmd-ctcp): Use dedicated function when | ||
| 4 | available. | ||
| 5 | (rcirc-ctcp-sender-PING): New function. | ||
| 6 | |||
| 1 | 2011-02-08 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2011-02-08 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * obsolete/pc-select.el: Rename from emulation/pc-select.el (bug#7940). | 9 | * obsolete/pc-select.el: Rename from emulation/pc-select.el (bug#7940). |
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 21934ce8b01..246f6335134 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el | |||
| @@ -2185,14 +2185,23 @@ With a prefix arg, prompt for new topic." | |||
| 2185 | 2185 | ||
| 2186 | (defun rcirc-cmd-ctcp (args &optional process target) | 2186 | (defun rcirc-cmd-ctcp (args &optional process target) |
| 2187 | (if (string-match "^\\([^ ]+\\)\\s-+\\(.+\\)$" args) | 2187 | (if (string-match "^\\([^ ]+\\)\\s-+\\(.+\\)$" args) |
| 2188 | (let ((target (match-string 1 args)) | 2188 | (let* ((target (match-string 1 args)) |
| 2189 | (request (match-string 2 args))) | 2189 | (request (upcase (match-string 2 args))) |
| 2190 | (rcirc-send-string process | 2190 | (function (intern-soft (concat "rcirc-ctcp-sender-" request)))) |
| 2191 | (format "PRIVMSG %s \C-a%s\C-a" | 2191 | (if (fboundp function) ;; use special function if available |
| 2192 | target (upcase request)))) | 2192 | (funcall function process target request) |
| 2193 | (rcirc-send-string process | ||
| 2194 | (format "PRIVMSG %s :\C-a%s\C-a" | ||
| 2195 | target request)))) | ||
| 2193 | (rcirc-print process (rcirc-nick process) "ERROR" nil | 2196 | (rcirc-print process (rcirc-nick process) "ERROR" nil |
| 2194 | "usage: /ctcp NICK REQUEST"))) | 2197 | "usage: /ctcp NICK REQUEST"))) |
| 2195 | 2198 | ||
| 2199 | (defun rcirc-ctcp-sender-PING (process target request) | ||
| 2200 | "Send a CTCP PING message to TARGET." | ||
| 2201 | (let ((timestamp (car (split-string (number-to-string (float-time)) "\\.")))) | ||
| 2202 | (rcirc-send-string process | ||
| 2203 | (format "PRIVMSG %s :\C-aPING %s\C-a" target timestamp)))) | ||
| 2204 | |||
| 2196 | (defun rcirc-cmd-me (args &optional process target) | 2205 | (defun rcirc-cmd-me (args &optional process target) |
| 2197 | (rcirc-send-string process (format "PRIVMSG %s :\C-aACTION %s\C-a" | 2206 | (rcirc-send-string process (format "PRIVMSG %s :\C-aACTION %s\C-a" |
| 2198 | target args))) | 2207 | target args))) |