diff options
author | Jonas Smedegaard <dr@jones.dk> | 2010-07-05 17:01:53 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2010-07-05 17:01:53 +0200 |
commit | 152225f45162807082d0c18d4760af8e73180d55 (patch) | |
tree | 70fb4db37e9d6637b84d702c1846108d2572fd1e /localsmsadmin | |
parent | f2342c5e7c74f62320f0a3b224b35ba7973d828c (diff) |
Add half-done "mission" command to localsmsadmin, and add TODO about missing part to localkannel-dispatch.
Diffstat (limited to 'localsmsadmin')
-rwxr-xr-x | localsmsadmin | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/localsmsadmin b/localsmsadmin index 3fb6d07..0fb6fc8 100755 --- a/localsmsadmin +++ b/localsmsadmin @@ -328,11 +328,49 @@ EOF # ;; # esac # ;; + mission) + case "$1" in + help) + cat <<EOF +Usage: +/mission AGENT @VICTIM msg... + +Send AGENT contact info on VICTIM. +When AGENT responds "done", msg is sent on behalf of VICTIM. +EOF +#TODO: Store mission as an object: +# Has an owner +# Can have subscribers who get progress info +# msg is stored in mission, is optional, and originator is mission owner (i.e. sending on behalf of victim is optional) + exit 0 + ;; + *) + agent="$1"; [ -n "$agent" ] || exit1 "Missing agent (try \"/mission help\" for usage info)!"; shift +#FIXME: strip leading @ from victim + victim="$1"; [ -n "$victim" ] || exit1 "Missing victim (try \"/mission help\" for usage info)!"; shift + [ -n "$*" ] || exit1 "Missing message (try \"/mission help\" for usage info)!" + agentname="$(findobjects user "$agent")"; [ -n "$agentname" ] || exit1 "Unknown agent \"$agent\" (try \"/mission help\" for usage info)!" + victimname="$(findobjects user "$victim")"; [ -n "$victimname" ] || exit1 "Unknown victim \"$victim\" (try \"/mission help\" for usage info)!" + victimphone="$(getitem user "$victim" phone)"; [ -n "$victimphone" ] || exit1 "Failed resolving victim phone to provide to agent." + task="Contact $victimname ($victimphone). When done send text: done" +#FIXME: store mission msg as missionpending item at agent user +#FIXME: send mission task to agent + cat <<EOF +Mission initiated: +$agentname: $task + +($@) +EOF + exit 0 + ;; + esac + ;; help) cat <<EOF Admin commands: /add user|group|session|default ... /del user|group|session|default ... +/mission AGENT @VICTIM msg... /COMMAND help try e.g. "/del help". |