+2005-02-18 Steve Youngs <steve@sxemacs.org>
+
+ * riece-ctcp.el (riece-handle-ctcp-time-request): New.
+ (riece-handle-ctcp-time-response): New.
+ (riece-command-ctcp-time): New.
+ (riece-ctcp-enable): Add `riece-command-ctcp-time'.
+ (riece-ctcp-disable): Ditto.
+
+ * riece-layout.el (riece-layout-alist): Minor doc string fix --
+ escape a couple of parens.
+
+ * riece-version.el: defvar sxemacs-codename at compile time.
+ (riece-extended-version): Simplify the XEmacs section, add support
+ for SXEmacs.
+
2005-02-17 TAKAHASHI Kaoru <kaoru@kaisei.org>
* riece-addon.el (riece-resolve-addons): Fixed
(concat (riece-concat-server-name (concat riece-ctcp-action-prefix user
" " string)) "\n"))))
+(defun riece-handle-ctcp-time-request (prefix target string)
+ (let* ((target-identity (riece-make-identity target riece-server-name))
+ (buffer (if (riece-channel-p target)
+ (riece-channel-buffer target-identity)))
+ (user (riece-prefix-nickname prefix))
+ (time (format-time-string "%c")))
+ (riece-send-string
+ (format "NOTICE %s :\1TIME %s\1\r\n" user time))
+ (riece-insert-change buffer (format "CTCP TIME from %s\n" user))
+ (riece-insert-change
+ (if (and riece-channel-buffer-mode
+ (not (eq buffer riece-channel-buffer)))
+ (list riece-dialogue-buffer riece-others-buffer)
+ riece-dialogue-buffer)
+ (concat
+ (riece-concat-server-name
+ (format "CTCP TIME from %s (%s) to %s"
+ user
+ (riece-strip-user-at-host (riece-prefix-user-at-host prefix))
+ (riece-format-identity target-identity t)))
+ "\n"))))
+
(defun riece-handle-ctcp-response (prefix string)
(when (and riece-ctcp-enabled prefix string
(riece-prefix-nickname prefix))
string))
"\n")))
+(defun riece-handle-ctcp-time-response (prefix target string)
+ (riece-insert-change
+ (list riece-dialogue-buffer riece-others-buffer)
+ (concat
+ (riece-concat-server-name
+ (format "CTCP TIME for %s (%s) = %s"
+ (riece-prefix-nickname prefix)
+ (riece-strip-user-at-host (riece-prefix-user-at-host prefix))
+ string))
+ "\n")))
+
(defun riece-command-ctcp-version (target)
(interactive
(list (riece-completing-read-identity
" (in " (riece-format-identity target t) ")")))
"\n"))))
+(defun riece-command-ctcp-time (target)
+ (interactive
+ (list (riece-completing-read-identity
+ "Channel/User: "
+ (riece-get-identities-on-server (riece-current-server-name)))))
+ (riece-send-string (format "PRIVMSG %s :\1TIME\1\r\n"
+ (riece-identity-prefix target))))
+
(defun riece-ctcp-requires ()
(if (memq 'riece-highlight riece-addons)
'(riece-highlight)))
(define-key riece-dialogue-mode-map "\C-cp" 'riece-command-ctcp-ping)
(define-key riece-dialogue-mode-map "\C-ca" 'riece-command-ctcp-action)
(define-key riece-dialogue-mode-map "\C-cc" 'riece-command-ctcp-clientinfo)
+ (define-key riece-dialogue-mode-map "\C-ct" 'riece-command-ctcp-time)
(setq riece-ctcp-enabled t))
(defun riece-ctcp-disable ()
(define-key riece-dialogue-mode-map "\C-cp" nil)
(define-key riece-dialogue-mode-map "\C-ca" nil)
(define-key riece-dialogue-mode-map "\C-cc" nil)
+ (define-key riece-dialogue-mode-map "\C-ct" nil)
(setq riece-ctcp-enabled nil))
(provide 'riece-ctcp)
"Version string for this version of Riece.")
(eval-when-compile
- (defvar xemacs-codename))
+ (defvar xemacs-codename)
+ (defvar sxemacs-codename))
(defun riece-extended-version ()
"Stringified Riece version and Emacs version.
(if system-v
(concat " (" system-v ")")
"")))
- ((string-match
- "\\([A-Z]*[Mm][Aa][Cc][Ss]\\)[^(]*\\(\\((beta.*)\\|'\\)\\)?"
- emacs-version)
- (concat
- (match-string 1 emacs-version)
- (format "/%d.%d" emacs-major-version emacs-minor-version)
- (if (match-beginning 3)
- (match-string 3 emacs-version)
- "")
- (if (boundp 'xemacs-codename)
- (concat
- " (" xemacs-codename
- (if system-v
- (concat ", " system-v ")")
- ")"))
- "")))
+ ((featurep 'sxemacs)
+ (concat "SXEmacs/" emacs-program-version
+ (when system-v
+ (concat " ("
+ (when sxemacs-codename
+ (concat sxemacs-codename ", "))
+ system-v ")"))))
+ ((featurep 'xemacs)
+ (concat "XEmacs/" emacs-program-version
+ (when system-v
+ (concat " ("
+ (when xemacs-codename
+ (concat xemacs-codename ", "))
+ system-v ")"))))
(t emacs-version))))
(if (stringp riece-user-agent)
riece-user-agent