`:coding'.
(riece-open-server): Follow the change.
* riece-ctcp.el (riece-command-ctcp-action): New command.
(riece-ctcp-insinuate): Bind it in riece-dialogue-mode-map.
(riece-handle-ctcp-action-request): New handler.
* riece.el (riece-command-mode): Enclose status indicators with
`{}'; show riece-user-indicator.
(riece-channel-mode): Likewise.
(riece-dialogue-mode): Enclose status indicators with `{}'.
* riece-globals.el (riece-user-indicator): New indicator.
(riece-freeze-indicator): Default to "-".
* riece-display.el (riece-update-channel-indicator): Don't update
modeline.
(riece-update-status-indicators): Set riece-user-indicator.
* riece-300.el (riece-handle-324-message): Update channel indicator.
+2003-06-03 Daiki Ueno <ueno@unixuser.org>
+
+ * riece-server.el (riece-server-keyword-map): `:coding-system' ->
+ `:coding'.
+ (riece-open-server): Follow the change.
+
+ * riece-ctcp.el (riece-command-ctcp-action): New command.
+ (riece-ctcp-insinuate): Bind it in riece-dialogue-mode-map.
+ (riece-handle-ctcp-action-request): New handler.
+
+ * riece.el (riece-command-mode): Enclose status indicators with
+ `{}'; show riece-user-indicator.
+ (riece-channel-mode): Likewise.
+ (riece-dialogue-mode): Enclose status indicators with `{}'.
+ * riece-globals.el (riece-user-indicator): New indicator.
+ (riece-freeze-indicator): Default to "-".
+ * riece-display.el (riece-update-channel-indicator): Don't update
+ modeline.
+ (riece-update-status-indicators): Set riece-user-indicator.
+ * riece-300.el (riece-handle-324-message): Update channel indicator.
+
2003-06-02 Daiki Ueno <ueno@unixuser.org>
* riece.el (riece-command-mode): Don't set riece-freeze-indicator.
(concat
(riece-concat-server-name
(format "Mode for %s: %s" channel mode-string))
- "\n"))))))
+ "\n")))
+ (riece-update-channel-indicator)
+ (force-mode-line-update t))))
(defun riece-handle-set-topic (prefix number name string remove)
(if (string-match "^\\([^ ]+\\) :" string)
(add-hook 'riece-privmsg-hook 'riece-handle-ctcp-request)
(add-hook 'riece-notice-hook 'riece-handle-ctcp-response)
(define-key riece-dialogue-mode-map "\C-cv" 'riece-command-ctcp-version)
- (define-key riece-dialogue-mode-map "\C-cp" 'riece-command-ctcp-ping))
+ (define-key riece-dialogue-mode-map "\C-cp" 'riece-command-ctcp-ping)
+ (define-key riece-dialogue-mode-map "\C-ca" 'riece-command-ctcp-action))
(defun riece-handle-ctcp-request (prefix string)
(when (and prefix string
target))
"\n"))))
+(defun riece-handle-ctcp-action-request (prefix target string)
+ (let ((buffer (if (riece-channel-p target)
+ (cdr (riece-identity-assoc-no-server
+ (riece-make-identity target)
+ riece-channel-buffer-alist))))
+ (user (riece-prefix-nickname prefix)))
+ (riece-insert-change buffer (concat user " " string "\n"))
+ (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 (concat user " " string)) "\n"))))
+
(defun riece-handle-ctcp-response (prefix string)
(when (and prefix string
(riece-prefix-nickname prefix))
(riece-send-string (format "PRIVMSG %s :\1PING\1\r\n" user))
(setq riece-ctcp-ping-time (current-time)))
+(defun riece-command-ctcp-action (channel action)
+ (interactive
+ (list (if current-prefix-arg
+ (completing-read
+ "Channel/User: "
+ (mapcar #'list riece-current-channels))
+ riece-current-channel)
+ (read-string "Action: ")))
+ (if (equal action "")
+ (error "No action"))
+ (riece-send-string (format "PRIVMSG %s :\1ACTION %s\1\r\n"
+ (riece-identity-prefix channel)
+ action))
+ (let ((buffer (cdr (riece-identity-assoc-no-server
+ (riece-make-identity channel)
+ riece-channel-buffer-alist))))
+ (riece-insert-change
+ buffer
+ (concat (riece-identity-prefix (riece-current-nickname)) " " action "\n"))
+ (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
+ (concat (riece-identity-prefix (riece-current-nickname)) " " action))
+ "\n"))))
+
(provide 'riece-ctcp)
-;;; riece-ctcp.el ends here
\ No newline at end of file
+;;; riece-ctcp.el ends here
(concat riece-current-channel ": "
(riece-channel-get-topic riece-current-channel))
riece-current-channel))
- "None"))
- (with-current-buffer riece-command-buffer
- (force-mode-line-update)))
+ "None")))
(defun riece-update-channel-list-indicator ()
(if (and riece-current-channels
(setq riece-channel-list-indicator "No channel")))
(defun riece-update-status-indicators ()
- (riece-with-server-buffer
- (setq riece-away-indicator
- (if (and riece-real-nickname
- (riece-user-get-away riece-real-nickname))
- "A"
- "-"))
- (setq riece-operator-indicator
- (if (and riece-real-nickname
- (riece-user-get-operator riece-real-nickname))
- "O"
- "-")))
+ (with-current-buffer riece-command-buffer
+ (riece-with-server-buffer
+ (setq riece-away-indicator
+ (if (and riece-real-nickname
+ (riece-user-get-away riece-real-nickname))
+ "A"
+ "-")
+ riece-operator-indicator
+ (if (and riece-real-nickname
+ (riece-user-get-operator riece-real-nickname))
+ "O"
+ "-")
+ riece-user-indicator riece-real-nickname)))
(setq riece-freeze-indicator
(with-current-buffer (if (and riece-channel-buffer-mode
riece-channel-buffer)
"A modeline indicator of the current channel.")
(defvar riece-channel-list-indicator "No channel"
"The current joined channels, \"pretty-printed.\".")
+(defvar riece-user-indicator nil)
(defvar riece-away-indicator "-")
(defvar riece-operator-indicator "-")
-(defvar riece-freeze-indicator nil)
-(defvar riece-own-freeze-indicator nil)
+(defvar riece-freeze-indicator "-")
;;; Buffers:
(defvar riece-command-buffer "*Commands*"
(:username riece-username)
(:password)
(:function #'open-network-stream)
- (:coding-system riece-default-coding-system))
+ (:coding riece-default-coding-system))
"Mapping from keywords to default values.
All keywords that can be used must be listed here."))
(with-current-buffer (process-buffer process)
(setq riece-last-nickname riece-real-nickname
riece-nick-accepted 'sent
- riece-coding-system coding-system))
+ riece-coding-system coding))
(if server-name
(setq riece-server-process-alist
(cons (cons server-name process)
(riece-mode-line-buffer-identification
'("Riece: "
mode-line-modified
+ "{"
riece-away-indicator
riece-operator-indicator
- "-- " riece-current-channel " " riece-real-nickname)))
+ riece-freeze-indicator
+ "} "
+ riece-user-indicator
+ " "
+ riece-channel-indicator)))
(riece-simplify-mode-line-format)
(use-local-map riece-command-mode-map)
(riece-mode-line-buffer-identification
'("Riece: "
mode-line-modified
+ "{"
riece-away-indicator
riece-operator-indicator
riece-freeze-indicator
- riece-own-freeze-indicator
- " " riece-channel-list-indicator " "))
+ "} "
+ riece-channel-list-indicator " "))
buffer-read-only t
tab-stop-list riece-tab-stop-list)
(riece-update-status-indicators)
(riece-mode-line-buffer-identification
'("Riece: "
mode-line-modified
+ "{"
riece-away-indicator
riece-operator-indicator
riece-freeze-indicator
- riece-own-freeze-indicator
+ "} "
+ riece-user-indicator
" "
riece-channel-indicator))))
(kill-all-local-variables)
(setq mode-line-modified "--- "
major-mode 'riece-user-list-mode
- mode-name "Riece Channel member"
+ mode-name "User list"
mode-line-buffer-identification
(riece-mode-line-buffer-identification
'("Riece: " riece-channel-indicator " "))
(defun riece-load-and-build-addon-dependencies (addons)
(let ((load-path (cons riece-addon-directory load-path))
- dependencies
- pointer)
+ dependencies)
(while addons
(require (car addons)) ;error will be reported here
(let* ((requires