From d9a9b54ba90b007d26c08646196e3409eed9fb88 Mon Sep 17 00:00:00 2001 From: ueno Date: Sat, 28 Feb 2004 21:33:37 +0000 Subject: [PATCH] * riece-display.el (riece-display-connect-signals): Connect some signals. * riece-naming.el (riece-naming-assert-join): Don't change the current channel manually. (riece-naming-assert-part): Ditto. (riece-naming-assert-rename): Ditto. (riece-naming-assert-channel-users): Ditto. --- lisp/ChangeLog | 11 +++++++++++ lisp/riece-display.el | 23 +++++++++++++++++++++++ lisp/riece-naming.el | 41 +++++++++++++---------------------------- 3 files changed, 47 insertions(+), 28 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fccfd0c..3748ff3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2004-02-28 Daiki Ueno + + * riece-display.el (riece-display-connect-signals): Connect some + signals. + + * riece-naming.el (riece-naming-assert-join): Don't change the + current channel manually. + (riece-naming-assert-part): Ditto. + (riece-naming-assert-rename): Ditto. + (riece-naming-assert-channel-users): Ditto. + 2004-02-27 Daiki Ueno * riece-display.el (riece-emit-signal): Create signal object diff --git a/lisp/riece-display.el b/lisp/riece-display.el index abaac35..9e65095 100644 --- a/lisp/riece-display.el +++ b/lisp/riece-display.el @@ -154,6 +154,15 @@ This function is for internal use only." (not (riece-identity-equal (car (riece-signal-args signal)) (riece-current-nickname)))))) (riece-connect-signal + 'riece-naming-assert-join + (lambda (signal handback) + (riece-join-channel (nth 1 (riece-signal-args signal))) + (riece-switch-to-channel (nth 1 (riece-signal-args signal))) + (setq riece-join-channel-candidate nil)) + (lambda (signal) + (riece-identity-equal (car (riece-signal-args signal)) + riece-current-nickname))) + (riece-connect-signal 'riece-naming-assert-part (lambda (signal handback) (save-excursion @@ -165,6 +174,13 @@ This function is for internal use only." (not (riece-identity-equal (car (riece-signal-args signal)) (riece-current-nickname)))))) (riece-connect-signal + 'riece-naming-assert-part + (lambda (signal handback) + (riece-part-channel (nth 1 (riece-signal-args signal))) + (lambda (signal) + (riece-identity-equal (car (riece-signal-args signal)) + riece-current-nickname)))) + (riece-connect-signal 'riece-naming-assert-rename (lambda (signal handback) (save-excursion @@ -190,6 +206,13 @@ This function is for internal use only." (riece-identity-equal (nth 1 (riece-signal-args signal)) (riece-current-nickname)))) (riece-connect-signal + 'riece-naming-assert-rename + (lambda (signal handback) + (riece-switch-to-channel (nth 1 (riece-signal-args signal)))) + (lambda (signal) + (riece-identity-equal (car (riece-signal-args signal)) + riece-current-channel))) + (riece-connect-signal 'riece-user-toggle-away (lambda (signal handback) (riece-update-status-indicators) diff --git a/lisp/riece-naming.el b/lisp/riece-naming.el index 044e4f9..7093938 100644 --- a/lisp/riece-naming.el +++ b/lisp/riece-naming.el @@ -32,30 +32,22 @@ (defun riece-naming-assert-join (user-name channel-name) (riece-user-toggle-channel user-name channel-name t) (riece-channel-toggle-user channel-name user-name t) - (let ((user-identity (riece-make-identity user-name - riece-server-name)) - (channel-identity (riece-make-identity channel-name - riece-server-name))) - (when (riece-identity-equal-no-server user-name riece-real-nickname) - (riece-join-channel channel-identity) - (riece-switch-to-channel channel-identity) - (setq riece-join-channel-candidate nil)) - (riece-emit-signal 'riece-naming-assert-join - user-identity channel-identity))) + (riece-emit-signal 'riece-naming-assert-join + (riece-make-identity user-name + riece-server-name) + (riece-make-identity channel-name + riece-server-name))) (defun riece-naming-assert-part (user-name channel-name) (riece-user-toggle-channel user-name channel-name nil) (riece-channel-toggle-user channel-name user-name nil) (riece-channel-toggle-operator channel-name user-name nil) (riece-channel-toggle-speaker channel-name user-name nil) - (let ((user-identity (riece-make-identity user-name - riece-server-name)) - (channel-identity (riece-make-identity channel-name - riece-server-name))) - (if (riece-identity-equal-no-server user-name riece-real-nickname) - (riece-part-channel channel-identity)) - (riece-emit-signal 'riece-naming-assert-part - user-identity channel-identity))) + (riece-emit-signal 'riece-naming-assert-part + (riece-make-identity user-name + riece-server-name) + (riece-make-identity channel-name + riece-server-name))) (defun riece-naming-assert-rename (old-name new-name) (if (riece-identity-equal-no-server old-name riece-real-nickname) @@ -83,9 +75,7 @@ (cons (cons new-identity (current-buffer)) (delq (riece-identity-assoc old-identity riece-channel-buffer-alist) - riece-channel-buffer-alist)))) - (if (riece-identity-equal old-identity riece-current-channel) - (riece-switch-to-channel new-identity))) + riece-channel-buffer-alist))))) (riece-emit-signal 'riece-naming-assert-rename old-identity new-identity))) @@ -106,13 +96,8 @@ (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) - (riece-join-channel channel-identity) - (riece-switch-to-channel channel-identity) - (setq riece-join-channel-candidate nil)) - (setq users (cdr users))) + user-identity-list) + users (cdr users))) (riece-emit-signal 'riece-naming-assert-channel-users (nreverse user-identity-list) channel-identity))) -- 1.7.10.4