From: ueno Date: Fri, 27 Feb 2004 09:16:29 +0000 (+0000) Subject: * riece-naming.el (riece-naming-assert-join): Rename signal 'join X-Git-Tag: signal-slot-mergepoint~18 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dec90c6ad1d0291f4b3bf4f84340d190c7cc9b82;p=elisp%2Friece.git * riece-naming.el (riece-naming-assert-join): Rename signal 'join -> 'riece-naming-assert-join. (riece-naming-assert-part): Rename signal 'part -> 'riece-naming-assert-part. (riece-naming-assert-rename): Rename signal 'rename -> 'riece-naming-assert-rename. (riece-naming-assert-channel-users): Rename from riece-naming-assert-users; rename signal 'users -> 'riece-naming-assert-channel-users. * riece-handle.el (riece-handle-topic-message): Emit 'riece-channel-set-topic signal. (riece-parse-channel-modes): Emit 'riece-channel-toggle-operator, 'riece-channel-toggle-speaker, and 'riece-channel-toggle-modes signals. * riece-display.el (riece-display-connect-signals): Rename some signals; connect more signals. * riece-300.el (riece-handle-302-message): Emit 'riece-user-toggle-away, and 'riece-user-toggle-operator signals; don't update status indicators manually. (riece-handle-301-message): Emit 'riece-user-toggle-away signal; don't update status indicators manually. (riece-handle-305-message): Ditto. (riece-handle-306-message): Ditto. (riece-handle-353-message): Follow the name change of riece-naming-assert-users. (riece-handle-324-message): Emit 'riece-channel-toggle-modes signal; don't update status indicators manually. (riece-handle-set-topic): Emit 'riece-channel-set-topic signal; don't update channel indicator manually. (riece-handle-352-message): Emit 'riece-user-toggle-away, and 'riece-user-toggle-operator signals; don't update status indicators manually. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7aaad87..a092dc1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,42 @@ 2004-02-27 Daiki Ueno + * riece-naming.el (riece-naming-assert-join): Rename signal 'join + -> 'riece-naming-assert-join. + (riece-naming-assert-part): Rename signal 'part -> + 'riece-naming-assert-part. + (riece-naming-assert-rename): Rename signal 'rename -> + 'riece-naming-assert-rename. + (riece-naming-assert-channel-users): Rename from + riece-naming-assert-users; rename signal 'users -> + 'riece-naming-assert-channel-users. + + * riece-handle.el (riece-handle-topic-message): Emit + 'riece-channel-set-topic signal. + (riece-parse-channel-modes): Emit 'riece-channel-toggle-operator, + 'riece-channel-toggle-speaker, and 'riece-channel-toggle-modes signals. + + * riece-display.el (riece-display-connect-signals): Rename some + signals; connect more signals. + + * riece-300.el (riece-handle-302-message): Emit + 'riece-user-toggle-away, and 'riece-user-toggle-operator signals; + don't update status indicators manually. + (riece-handle-301-message): Emit 'riece-user-toggle-away signal; + don't update status indicators manually. + (riece-handle-305-message): Ditto. + (riece-handle-306-message): Ditto. + (riece-handle-353-message): Follow the name change of + riece-naming-assert-users. + (riece-handle-324-message): Emit 'riece-channel-toggle-modes + signal; don't update status indicators manually. + (riece-handle-set-topic): Emit 'riece-channel-set-topic signal; + don't update channel indicator manually. + (riece-handle-352-message): Emit 'riece-user-toggle-away, and + 'riece-user-toggle-operator signals; don't update status + indicators manually. + +2004-02-27 Daiki Ueno + * riece-display.el (riece-connect-signal): Create slot object internally. diff --git a/lisp/riece-300.el b/lisp/riece-300.el index bf1f52f..995a214 100644 --- a/lisp/riece-300.el +++ b/lisp/riece-300.el @@ -52,7 +52,19 @@ (if operator (setq status (cons "operator" status))) (riece-user-toggle-away user away) + (riece-emit-signal (riece-make-signal + 'riece-user-toggle-away + (riece-make-identity + user + riece-server-name) + away)) (riece-user-toggle-operator user operator) + (riece-emit-signal (riece-make-signal + 'riece-user-toggle-operator + (riece-make-identity + user + riece-server-name) + operator)) (riece-insert-info (list riece-dialogue-buffer riece-others-buffer) (concat @@ -65,9 +77,7 @@ t) (riece-strip-user-at-host user-at-host)))) "\n")))) - (setq replies (cdr replies))) - (riece-update-status-indicators) - (force-mode-line-update t))) + (setq replies (cdr replies))))) (defun riece-handle-303-message (prefix number name string) (riece-insert-info @@ -89,6 +99,12 @@ (let ((user (match-string 1 string)) (message (substring string (match-end 0)))) (riece-user-toggle-away user t) + (riece-emit-signal (riece-make-signal + 'riece-user-toggle-away + (riece-make-identity + user + riece-server-name) + t)) (riece-insert-info (list riece-dialogue-buffer riece-others-buffer) (concat @@ -98,19 +114,25 @@ (riece-make-identity user riece-server-name) t) message)) - "\n")))) - (riece-update-status-indicators) - (force-mode-line-update t)) + "\n"))))) (defun riece-handle-305-message (prefix number name string) (riece-user-toggle-away riece-real-nickname nil) - (riece-update-status-indicators) - (force-mode-line-update t)) + (riece-emit-signal (riece-make-signal + 'riece-user-toggle-away + (riece-make-identity + riece-real-nickname + riece-server-name) + nil))) (defun riece-handle-306-message (prefix number name string) (riece-user-toggle-away riece-real-nickname t) - (riece-update-status-indicators) - (force-mode-line-update t)) + (riece-emit-signal (riece-make-signal + 'riece-user-toggle-away + (riece-make-identity + riece-real-nickname + riece-server-name) + t))) (defun riece-handle-311-message (prefix number name string) (if (string-match @@ -239,7 +261,7 @@ (list (match-string 2 string) ?v))) (list (match-string 2 string))) users (cons user users))) - (riece-naming-assert-names (nreverse users) channel) + (riece-naming-assert-channel-users (nreverse users) channel) (let* ((channel-identity (riece-make-identity channel riece-server-name)) (buffer (riece-channel-buffer channel-identity))) @@ -287,6 +309,12 @@ (while modes (riece-channel-toggle-mode channel (car modes) (eq toggle ?+)) (setq modes (cdr modes))) + (riece-emit-signal (riece-make-signal + 'riece-channel-toggle-modes + (riece-make-identity + channel + riece-server-name) + modes (eq toggle ?+))) (let* ((channel-identity (riece-make-identity channel riece-server-name)) (buffer (riece-channel-buffer channel-identity))) @@ -301,9 +329,7 @@ (format "Mode for %s: %s" (riece-format-identity channel-identity t) mode-string)) - "\n"))) - (riece-update-channel-indicator) - (force-mode-line-update t)))) + "\n")))))) (defun riece-handle-set-topic (prefix number name string remove) (if (string-match "^\\([^ ]+\\) :" string) @@ -314,19 +340,23 @@ (if remove (riece-channel-set-topic (riece-get-channel channel) nil) (riece-channel-set-topic (riece-get-channel channel) message) - (riece-insert-info buffer (concat "Topic: " message "\n")) - (riece-insert-info - (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 "Topic for %s: %s" - (riece-format-identity channel-identity t) - message)) - "\n")) - (riece-update-channel-indicator))))) + (riece-insert-info buffer (concat "Topic: " message "\n")) + (riece-insert-info + (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 "Topic for %s: %s" + (riece-format-identity channel-identity t) + message)) + "\n"))) + (riece-emit-signal (riece-make-signal + 'riece-channel-set-topic + channel-identity + (unless remove + message)))))) (defun riece-handle-331-message (prefix number name string) (riece-handle-set-topic prefix number name string t)) @@ -390,7 +420,19 @@ (setq status (nreverse status))) (riece-naming-assert-join nick channel) (riece-user-toggle-away user away) + (riece-emit-signal (riece-make-signal + 'riece-user-toggle-away + (riece-make-identity + user + riece-server-name) + away)) (riece-user-toggle-operator user operator) + (riece-emit-signal (riece-make-signal + 'riece-user-toggle-operator + (riece-make-identity + user + riece-server-name) + operator)) (riece-insert-info buffer (concat (riece-concat-user-status status info) "\n")) diff --git a/lisp/riece-display.el b/lisp/riece-display.el index db8ff5b..91afbaa 100644 --- a/lisp/riece-display.el +++ b/lisp/riece-display.el @@ -119,11 +119,12 @@ are the data of the signal." (defun riece-display-connect-signals () (riece-connect-signal - 'switch-to-channel + 'riece-switch-to-channel (lambda (signal handback) (riece-update-status-indicators) (riece-update-channel-indicator) (riece-update-long-channel-indicator) + (force-mode-line-update t) (save-excursion (set-buffer riece-user-list-buffer) (run-hooks 'riece-update-buffer-functions)) @@ -133,13 +134,13 @@ are the data of the signal." (save-excursion (riece-redraw-layout)))) (riece-connect-signal - 'names + 'riece-naming-assert-channel-users (lambda (signal handback) (save-excursion (set-buffer riece-user-list-buffer) (run-hooks 'riece-update-buffer-functions)))) (riece-connect-signal - 'join + 'riece-naming-assert-join (lambda (signal handback) (save-excursion (set-buffer riece-user-list-buffer) @@ -150,7 +151,7 @@ are the data of the signal." (not (riece-identity-equal (car (riece-signal-args signal)) (riece-current-nickname)))))) (riece-connect-signal - 'part + 'riece-naming-assert-part (lambda (signal handback) (save-excursion (set-buffer riece-user-list-buffer) @@ -161,7 +162,7 @@ are the data of the signal." (not (riece-identity-equal (car (riece-signal-args signal)) (riece-current-nickname)))))) (riece-connect-signal - 'rename + 'riece-naming-assert-rename (lambda (signal handback) (save-excursion (set-buffer riece-user-list-buffer) @@ -177,13 +178,64 @@ are the data of the signal." riece-current-channel)) t))))) (riece-connect-signal - 'rename + 'riece-naming-assert-rename (lambda (signal handback) (riece-update-status-indicators) - (riece-update-channel-indicator)) + (riece-update-channel-indicator) + (force-mode-line-update t)) + (lambda (signal) + (riece-identity-equal (nth 1 (riece-signal-args signal)) + (riece-current-nickname)))) + (riece-connect-signal + 'riece-user-toggle-away + (lambda (signal handback) + (riece-update-status-indicators) + (force-mode-line-update t)) + (lambda (signal) + (riece-identity-equal (nth 1 (riece-signal-args signal)) + (riece-current-nickname)))) + (riece-connect-signal + 'riece-user-toggle-operator + (lambda (signal handback) + (riece-update-status-indicators) + (force-mode-line-update t)) (lambda (signal) (riece-identity-equal (nth 1 (riece-signal-args signal)) - (riece-current-nickname))))) + (riece-current-nickname)))) + (riece-connect-signal + 'riece-channel-set-topic + (lambda (signal handback) + (riece-update-long-channel-indicator) + (force-mode-line-update t)) + (lambda (signal) + (riece-identity-equal (car (riece-signal-args signal)) + riece-current-channel))) + (riece-connect-signal + 'riece-channel-toggle-modes + (lambda (signal handback) + (riece-update-status-indicators) + (force-mode-line-update t)) + (lambda (signal) + (riece-identity-equal (car (riece-signal-args signal)) + riece-current-channel))) + (riece-connect-signal + 'riece-channel-toggle-operator + (lambda (signal handback) + (save-excursion + (set-buffer riece-user-list-buffer) + (run-hooks 'riece-update-buffer-functions))) + (lambda (signal) + (riece-identity-equal (car (riece-signal-args signal)) + riece-current-channel))) + (riece-connect-signal + 'riece-channel-toggle-speaker + (lambda (signal handback) + (save-excursion + (set-buffer riece-user-list-buffer) + (run-hooks 'riece-update-buffer-functions))) + (lambda (signal) + (riece-identity-equal (car (riece-signal-args signal)) + riece-current-channel)))) (defun riece-update-user-list-buffer () (save-excursion @@ -349,7 +401,7 @@ are the data of the signal." (setq riece-current-channel identity riece-channel-buffer (riece-channel-buffer riece-current-channel)) (run-hook-with-args 'riece-after-switch-to-channel-functions last) - (riece-emit-signal (riece-make-signal 'switch-to-channel)))) + (riece-emit-signal (riece-make-signal 'riece-switch-to-channel)))) (defun riece-join-channel (identity) (unless (riece-identity-member identity riece-current-channels) @@ -380,7 +432,7 @@ are the data of the signal." (let ((last riece-current-channel)) (run-hook-with-args 'riece-after-switch-to-channel-functions last) (setq riece-current-channel nil) - (riece-emit-signal (riece-make-signal 'switch-to-channel)))))) + (riece-emit-signal (riece-make-signal 'riece-switch-to-channel)))))) (defun riece-part-channel (identity) (let ((pointer (riece-identity-member identity riece-current-channels))) diff --git a/lisp/riece-handle.el b/lisp/riece-handle.el index 8d835cc..ee2b73f 100644 --- a/lisp/riece-handle.el +++ b/lisp/riece-handle.el @@ -323,6 +323,10 @@ (user-identity (riece-make-identity user riece-server-name)) (channel-identity (riece-make-identity channel riece-server-name))) (riece-channel-set-topic (riece-get-channel channel) topic) + (riece-emit-signal (riece-make-signal + 'riece-channel-set-topic + channel-identity + topic)) (let ((buffer (riece-channel-buffer channel-identity))) (riece-insert-change buffer @@ -355,10 +359,28 @@ (cond ((eq (car modes) ?o) (riece-channel-toggle-operator channel parameter - (eq toggle ?+))) + (eq toggle ?+)) + (riece-emit-signal (riece-make-signal + 'riece-channel-toggle-operator + (riece-make-identity + channel + riece-server-name) + (riece-make-identity + parameter + riece-server-name) + (eq toggle ?+)))) ((eq (car modes) ?v) (riece-channel-toggle-speaker channel parameter - (eq toggle ?+))) + (eq toggle ?+)) + (riece-emit-signal (riece-make-signal + 'riece-channel-toggle-speaker + (riece-make-identity + channel + riece-server-name) + (riece-make-identity + parameter + riece-server-name) + (eq toggle ?+)))) ((eq (car modes) ?b) (riece-channel-toggle-banned channel parameter (eq toggle ?+))) @@ -370,7 +392,13 @@ (eq toggle ?+))))) (riece-channel-toggle-mode channel (car modes) (eq toggle ?+))) - (setq modes (cdr modes)))))) + (setq modes (cdr modes))) + (riece-emit-signal (riece-make-signal + 'riece-channel-toggle-modes + (riece-make-identity + channel + riece-server-name) + modes toggle))))) (defun riece-handle-mode-message (prefix string) (let* ((user (riece-prefix-nickname prefix)) diff --git a/lisp/riece-naming.el b/lisp/riece-naming.el index e35e107..1e9352e 100644 --- a/lisp/riece-naming.el +++ b/lisp/riece-naming.el @@ -40,7 +40,7 @@ (riece-join-channel channel-identity) (riece-switch-to-channel channel-identity) (setq riece-join-channel-candidate nil)) - (riece-emit-signal (riece-make-signal 'join + (riece-emit-signal (riece-make-signal 'riece-naming-assert-join user-identity channel-identity)))) @@ -55,7 +55,7 @@ riece-server-name))) (if (riece-identity-equal-no-server user-name riece-real-nickname) (riece-part-channel channel-identity)) - (riece-emit-signal (riece-make-signal 'part + (riece-emit-signal (riece-make-signal 'riece-naming-assert-part user-identity channel-identity)))) @@ -88,9 +88,10 @@ riece-channel-buffer-alist)))) (if (riece-identity-equal old-identity riece-current-channel) (riece-switch-to-channel new-identity))) - (riece-emit-signal (riece-make-signal 'rename old-identity new-identity)))) + (riece-emit-signal (riece-make-signal 'riece-naming-assert-rename + old-identity new-identity)))) -(defun riece-naming-assert-names (users channel-name) +(defun riece-naming-assert-channel-users (users channel-name) (let ((channel-identity (riece-make-identity channel-name riece-server-name)) user-identity-list) @@ -98,16 +99,15 @@ (riece-user-toggle-channel (car (car users)) channel-name t) (riece-channel-toggle-user channel-name (car (car users)) t) (if (memq ?o (cdr (car users))) - (riece-channel-toggle-operator channel-name - (car (car users)) - t) + (riece-channel-toggle-operator channel-name (car (car users)) t) (if (memq ?v (cdr (car users))) - (riece-channel-toggle-speaker channel-name - (car (car users)) - t))) + (riece-channel-toggle-speaker channel-name (car (car users)) t) + (riece-channel-toggle-operator channel-name (car (car users)) nil) + (riece-channel-toggle-speaker channel-name (car (car users)) nil))) (setq user-identity-list - (cons (riece-make-identity (car (car users)) - riece-server-name) + (cons (cons (riece-make-identity (car (car users)) + riece-server-name) + (cdr (car users))) user-identity-list)) (when (riece-identity-equal-no-server (car (car users)) riece-real-nickname) @@ -115,7 +115,7 @@ (riece-switch-to-channel channel-identity) (setq riece-join-channel-candidate nil)) (setq users (cdr users))) - (riece-emit-signal (riece-make-signal 'names + (riece-emit-signal (riece-make-signal 'riece-naming-assert-channel-users (nreverse user-identity-list) channel-identity))))