/**********************************************************************
 * do_reply.c  -- SS command for replying to a question
 * tty lucy client using SS library
 *
 * $Author: brlewis $
 * $Source: /afs/athena.mit.edu/astaff/project/lucydev/src/tty/do_reply.c,v $
 * $Header: /afs/athena.mit.edu/astaff/project/lucydev/src/tty/do_reply.c,v 1.1 91/09/24 14:45:41 brlewis Exp Locker: brlewis $
 *
 * Copyright 1991 by the Massachusetts Institute of Technology.
 *
 * For copying and distribution information, please see the file
 * <mit-copyright.h>.
 **********************************************************************/
#include <mit-copyright.h>

#ifndef lint
static char rcsid_do_reply_c[] = "$Header: /afs/athena.mit.edu/astaff/project/lucydev/src/tty/do_reply.c,v 1.1 91/09/24 14:45:41 brlewis Exp Locker: brlewis $";
#endif /* lint */

#include <stdio.h>
#include <ss/ss.h>
#include "lucy/lucy.h"
#include "config.h"

void
do_reply(argc, argv)
     int argc;
     char *argv[];
{
  long code;

  /* Check usage */
  if (argc < 3 || !atoi(argv[1])) {
    printf("Usage: %s number recipient.\n", argv[0]);
    return;
  }

  /* Show what is about to be sent */
  do_show(2, argv);
  if (!say_yes("Is this what you want to send?", 0)) return;

  /* call luc_reply */
  code = luc_reply(luv_curmtgp, atoi(argv[1]), argv[2]);
  if (code)
    {
      com_err(argv[0], code, "(%s)", luv_context);
      return;
    }
  else
    {
      printf("Sent reply %s to %s.\n", argv[1], argv[2]);
#ifdef LOG_USAGE
      log_view("reply");
#endif
    }
  return;
}
