summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <jonas@atreju.jones.dk>2012-10-12 01:21:13 +0200
committerJonas Smedegaard <jonas@atreju.jones.dk>2012-10-12 01:22:09 +0200
commit2b5deac2609d3479eabb7acb05b40875a6a9161d (patch)
tree6e6aed3e9d18d289ecfee492f81218cbf91a56dd
parent086a44af71491ba7845c54bfca786d562e1ccb66 (diff)
Add draft send plugin, and add option origin to chain plugin.
-rw-r--r--lib/App/smsg/Command/Chain.pm1
-rw-r--r--lib/App/smsg/Command/Send.pm52
2 files changed, 53 insertions, 0 deletions
diff --git a/lib/App/smsg/Command/Chain.pm b/lib/App/smsg/Command/Chain.pm
index 90dc24f..5c1c6e5 100644
--- a/lib/App/smsg/Command/Chain.pm
+++ b/lib/App/smsg/Command/Chain.pm
@@ -32,6 +32,7 @@ then interactively prompted for.
DESCRIPTION
use constant opt_spec => (
['target|to=s', "Recipient ID"],
+ ['origin|from=s', "Faked sender ID"],
['platform|on=s', "Platform to operate on. Either generic (chat, sms, microblog) or specific (kannel, jabber, irc, twitter, status.net)."],
['intermediary|via=s', "Message center, host or net to use in case of multiple routes"],
[],
diff --git a/lib/App/smsg/Command/Send.pm b/lib/App/smsg/Command/Send.pm
new file mode 100644
index 0000000..facbde5
--- /dev/null
+++ b/lib/App/smsg/Command/Send.pm
@@ -0,0 +1,52 @@
+package App::smsg::Command::Send;
+
+use 5.010;
+use strict;
+use warnings;
+use utf8;
+
+BEGIN {
+ $App::smsg::Command::Send::AUTHORITY = 'https://dr.jones.dk/me#me';
+ $App::smsg::Command::Send::VERSION = '0.001';
+}
+
+use App::smsg -command;
+use namespace::clean;
+
+use constant abstract => q (Send a message to one or more recipients.);
+use constant usage_desc => '%c send %o <recipient>...';
+use constant description => <<'DESCRIPTION';
+Send a message to one or more targets.
+Targets can be single recipients or groups, when defined.
+
+When an option is needed but not provided, it is attempted resolved from
+previous related communication, then from defaults, and then
+interactively prompted for.
+DESCRIPTION
+use constant opt_spec => (
+ ['origin|from=s', "Faked sender ID"],
+ ['target|to=s', "Recipient ID"],
+ ['platform|on=s', "Platform to operate on. Either generic (chat, sms, microblog) or specific (kannel, jabber, irc, twitter, status.net)."],
+ ['intermediary|via=s', "Message center, host or net to use in case of multiple routes"],
+ [],
+# [ 'verbose|v', "print extra stuff"],
+ [ 'debug', "print debug stuff"],
+);
+
+sub validate_args {
+ my ($self, $opt, $args) = @_;
+
+ $self->usage_error("too few arguments") unless @$args >= 1;
+}
+
+sub execute {
+ my ($self, $opt, $args) = @_;
+
+# TODO: error if pause and no active chain
+# TODO: error if continue and no paused chain
+
+ die 'FIXME: unimplemented!';
+
+}
+
+1;