diff options
| author | fukachan <fukachan> | 2006-01-07 14:43:25 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2006-01-07 14:43:25 +0000 |
| commit | 25d1cf9ab50bc471d9950bf0c52d951606d63f43 (patch) | |
| tree | 6f9461ae8e50f0caebf7cc6cffdc14c4421bbdc6 /fml/lib/FML/Command/User | |
| parent | dfe9c96d982bd1742bb400c40f5f85fe2781d63e (diff) | |
| download | fml8-25d1cf9ab50bc471d9950bf0c52d951606d63f43.tar.gz fml8-25d1cf9ab50bc471d9950bf0c52d951606d63f43.tar.bz2 fml8-25d1cf9ab50bc471d9950bf0c52d951606d63f43.zip | |
move location of reseting compare_level.
rewritten to call FML::Command::Message->send_notification() not
direct reply_message() calls in Command::User:: class.
send_notification() works differently according to the value of
$XXX_command_auth_type variable.
Diffstat (limited to 'fml/lib/FML/Command/User')
| -rw-r--r-- | fml/lib/FML/Command/User/chaddr.pm | 17 | ||||
| -rw-r--r-- | fml/lib/FML/Command/User/subscribe.pm | 14 | ||||
| -rw-r--r-- | fml/lib/FML/Command/User/unsubscribe.pm | 14 |
3 files changed, 27 insertions, 18 deletions
diff --git a/fml/lib/FML/Command/User/chaddr.pm b/fml/lib/FML/Command/User/chaddr.pm index d486ef88..1e737e1b 100644 --- a/fml/lib/FML/Command/User/chaddr.pm +++ b/fml/lib/FML/Command/User/chaddr.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: chaddr.pm,v 1.33 2005/11/30 23:30:38 fukachan Exp $ +# $FML: chaddr.pm,v 1.34 2005/11/30 23:34:45 fukachan Exp $ # package FML::Command::User::chaddr; @@ -172,6 +172,8 @@ sub process # 1. request from $old_addr : $old_addr (member now) -> $new_addr # 2. request from $new_addr : $old_addr -> $new_addr (member now) if ($cred->is_member($old_addr) || $cred->is_member($new_addr)) { + $cred->set_compare_level( $compare_level ); + $curproc->log("chaddr request, try confirmation"); # XXX-TODO: no confirmation case ? @@ -184,9 +186,14 @@ sub process address => "$old_addr $new_addr", buffer => $command, }; - my $id = $confirm->assign_id; - $curproc->reply_message_nl('command.confirm', '', $optargs); - $curproc->reply_message("\n$id\n", $optargs); + + use FML::Command::Message; + my $_msg = new FML::Command::Message; + my $sc_args = { + command => "chaddr", + rm_args => $optargs, + }; + $_msg->send_confirmation($curproc, $command_args, $confirm, $sc_args); } # try confirmation before chaddr. else { @@ -194,8 +201,6 @@ sub process $cred->set_compare_level( $compare_level ); croak("not member"); } - - $cred->set_compare_level( $compare_level ); } diff --git a/fml/lib/FML/Command/User/subscribe.pm b/fml/lib/FML/Command/User/subscribe.pm index 97921978..202b604e 100644 --- a/fml/lib/FML/Command/User/subscribe.pm +++ b/fml/lib/FML/Command/User/subscribe.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: subscribe.pm,v 1.33 2005/08/11 04:07:33 fukachan Exp $ +# $FML: subscribe.pm,v 1.34 2005/11/30 23:30:38 fukachan Exp $ # package FML::Command::User::subscribe; @@ -116,6 +116,8 @@ sub process } # if not, try confirmation before subscribe else { + $cred->set_compare_level( $compare_level ); + $curproc->log("new subscriber, try confirmation"); use FML::Confirm; my $confirm = new FML::Confirm $curproc, { @@ -125,12 +127,12 @@ sub process address => $address, buffer => $command, }; - my $id = $confirm->assign_id; - $curproc->reply_message_nl('command.confirm'); - $curproc->reply_message("\n$id\n"); - } - $cred->set_compare_level( $compare_level ); + use FML::Command::Message; + my $_msg = new FML::Command::Message; + my $sc_args = { command => "subscribe" }; + $_msg->send_confirmation($curproc, $command_args, $confirm, $sc_args); + } } diff --git a/fml/lib/FML/Command/User/unsubscribe.pm b/fml/lib/FML/Command/User/unsubscribe.pm index 0d0ba6d7..d36662ab 100644 --- a/fml/lib/FML/Command/User/unsubscribe.pm +++ b/fml/lib/FML/Command/User/unsubscribe.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: unsubscribe.pm,v 1.34 2005/08/11 04:07:33 fukachan Exp $ +# $FML: unsubscribe.pm,v 1.35 2005/11/30 23:30:38 fukachan Exp $ # package FML::Command::User::unsubscribe; @@ -112,6 +112,8 @@ sub process } # try confirmation before unsubscribe else { + $cred->set_compare_level( $compare_level ); + $curproc->log("unsubscribe request, try confirmation"); use FML::Confirm; @@ -122,12 +124,12 @@ sub process address => $address, buffer => $command, }; - my $id = $confirm->assign_id; - $curproc->reply_message_nl('command.confirm'); - $curproc->reply_message("\n$id\n"); - } - $cred->set_compare_level( $compare_level ); + use FML::Command::Message; + my $_msg = new FML::Command::Message; + my $sc_args = { command => "unsubscribe" }; + $_msg->send_confirmation($curproc, $command_args, $confirm, $sc_args); + } } |
