summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Command.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2002-07-14 15:15:27 +0000
committerfukachan <fukachan>2002-07-14 15:15:27 +0000
commit791073bd93a78124f348ca70d045f671c2f4eabb (patch)
tree9bf9ab513db02935a9a43e25851cca4b87efce91 /fml/lib/FML/Command.pm
parent4345159846ffb68770a0b6794decb84eb5eba9e9 (diff)
downloadfml8-791073bd93a78124f348ca70d045f671c2f4eabb.tar.gz
fml8-791073bd93a78124f348ca70d045f671c2f4eabb.tar.bz2
fml8-791073bd93a78124f348ca70d045f671c2f4eabb.zip
copy message and send it to $maintainer too
use reply_message*() with $msg_args to copy the message if needed where $msg_args = { always_cc => $maintainer } or $msg_args = { recipient => $maintinaer } pertinently.
Diffstat (limited to 'fml/lib/FML/Command.pm')
-rw-r--r--fml/lib/FML/Command.pm35
1 files changed, 33 insertions, 2 deletions
diff --git a/fml/lib/FML/Command.pm b/fml/lib/FML/Command.pm
index 204444b3..b3314cd4 100644
--- a/fml/lib/FML/Command.pm
+++ b/fml/lib/FML/Command.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: Command.pm,v 1.26 2002/06/30 14:27:47 fukachan Exp $
+# $FML: Command.pm,v 1.27 2002/06/30 14:30:12 fukachan Exp $
#
package FML::Command;
@@ -72,7 +72,8 @@ buffer.
# Descriptions: rewrite prompt buffer
-# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args) STR_REF($rbuf)
+# Arguments: OBJ($self)
+# OBJ($curproc) HASH_REF($command_args) STR_REF($rbuf)
# Side Effects: none
# Return Value: none
sub rewrite_prompt
@@ -93,6 +94,36 @@ sub rewrite_prompt
}
+
+=head2 C<notice_cc_recipient($curproc, $command_args, $rbuf)>
+
+return addresses to inform for the command reply.
+
+=cut
+
+
+# Descriptions: return addresses to inform
+# Arguments: OBJ($self) OBJ($curproc) HASH_REF($command_args)
+# Side Effects: none
+# Return Value: ARRAY_REF
+sub notice_cc_recipient
+{
+ my ($self, $curproc, $command_args) = @_;
+ my $command = undef;
+ my $comname = $command_args->{ comname };
+ my $mode =
+ $command_args->{'command_mode'} =~ /admin/i ? 'Admin' : 'User';
+ my $pkg = "FML::Command::${mode}::${comname}";
+
+ eval qq{ use $pkg; \$command = new $pkg;};
+ unless ($@) {
+ if ($command->can('notice_cc_recipient')) {
+ $command->notice_cc_recipient($curproc, $command_args);
+ }
+ }
+}
+
+
=head2 C<AUTOLOAD()>
the command dispatcher.