summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Command/User
diff options
context:
space:
mode:
authorfukachan <fukachan>2004-03-13 11:46:32 +0000
committerfukachan <fukachan>2004-03-13 11:46:32 +0000
commita1401345e5a22c92d0f325dc8f8b00b2279dc0b9 (patch)
treeb5bff0398136b0a54a9f8dd5f17015132f0eeabb /fml/lib/FML/Command/User
parent62318e6f2ef21ea01483fc569dee0e199970e0c3 (diff)
downloadfml8-a1401345e5a22c92d0f325dc8f8b00b2279dc0b9.tar.gz
fml8-a1401345e5a22c92d0f325dc8f8b00b2279dc0b9.tar.bz2
fml8-a1401345e5a22c92d0f325dc8f8b00b2279dc0b9.zip
fml --allow-send-message allows makefml/fml sends reply messages.
currently user mode "subscribe" and "unsubcribe" support this style.
Diffstat (limited to 'fml/lib/FML/Command/User')
-rw-r--r--fml/lib/FML/Command/User/subscribe.pm18
-rw-r--r--fml/lib/FML/Command/User/unsubscribe.pm18
2 files changed, 28 insertions, 8 deletions
diff --git a/fml/lib/FML/Command/User/subscribe.pm b/fml/lib/FML/Command/User/subscribe.pm
index d933e046..9565f631 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.25 2004/02/15 04:38:31 fukachan Exp $
+# $FML: subscribe.pm,v 1.26 2004/02/24 14:36:53 fukachan Exp $
#
package FML::Command::User::subscribe;
@@ -85,11 +85,21 @@ sub process
my $cache_dir = $config->{ db_dir };
my $keyword = $config->{ confirm_command_prefix };
my $command = $command_args->{ command };
- my $address = $cred->sender();
+ my $options = $command_args->{ options };
+ my $address =
+ $command_args->{ command_data } || $options->[ 0 ] || $cred->sender();
# fundamental check
- croak("\$member_map is not specified") unless $member_map;
- croak("\$recipient_map is not specified") unless $recipient_map;
+ croak("\$member_map unspecified") unless $member_map;
+ croak("\$recipient_map unspecified") unless $recipient_map;
+ croak("\$address unspecified") unless $address;
+
+ # XXX extension: fml --allow-send-message or fml --allow-reply-message
+ unless ($cred->sender()) {
+ if ($curproc->allow_reply_message()) {
+ $cred->set_sender($address);
+ }
+ }
# exatct match as could as possible.
my $compare_level = $cred->get_compare_level();
diff --git a/fml/lib/FML/Command/User/unsubscribe.pm b/fml/lib/FML/Command/User/unsubscribe.pm
index 24ce8ab3..ce0ef478 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.26 2004/02/15 04:38:31 fukachan Exp $
+# $FML: unsubscribe.pm,v 1.27 2004/02/24 14:36:53 fukachan Exp $
#
package FML::Command::User::unsubscribe;
@@ -84,11 +84,21 @@ sub process
my $cache_dir = $config->{ db_dir };
my $keyword = $config->{ confirm_command_prefix };
my $command = $command_args->{ command };
- my $address = $cred->sender();
+ my $options = $command_args->{ options };
+ my $address =
+ $command_args->{ command_data } || $options->[ 0 ] || $cred->sender();
# cheap sanity checks
- croak("\$member_map is not specified") unless $member_map;
- croak("\$recipient_map is not specified") unless $recipient_map;
+ croak("\$member_map unspecified") unless $member_map;
+ croak("\$recipient_map unspecified") unless $recipient_map;
+ croak("\$address unspecified") unless $address;
+
+ # XXX extension: fml --allow-send-message or fml --allow-reply-message
+ unless ($cred->sender()) {
+ if ($curproc->allow_reply_message()) {
+ $cred->set_sender($address);
+ }
+ }
# exatct match as could as possible.
my $compare_level = $cred->get_compare_level();