# HG changeset patch # User Sean Egan # Date 1033077094 0 # Node ID 119b8950a1c82a2cdc3c8d81469f80e15d38116b # Parent ea617b23ddacb04f237a48e7889faed7db5d146d [gaim-migrate @ 3653] gaim-remote quit Thanks John Silvestri. committer: Tailor Script diff -r ea617b23ddac -r 119b8950a1c8 src/gaim-remote.c --- a/src/gaim-remote.c Thu Sep 26 21:46:53 2002 +0000 +++ b/src/gaim-remote.c Thu Sep 26 21:51:34 2002 +0000 @@ -35,7 +35,8 @@ " convo Open a new conversation window\n" " send Send message\n" " add Add buddy to buddy list\n" - " remove Remove buddy from list\n\n" + " remove Remove buddy from list\n" + " quit Close running copy of Gaim\n\n" " OPTIONS:\n" " -m, --message=MESG Message to send or show in conversation window\n" @@ -135,9 +136,24 @@ return 0; } +int command_quit() { + int fd = 0; + struct gaim_cui_packet *p = NULL; + fd = gaim_connect_to_session(0); + if (!fd) { + fprintf(stderr, "Gaim not running (on session 0)\n"); + return 1; + } + p = cui_packet_new(CUI_TYPE_META, CUI_META_QUIT); + cui_send_packet (fd, p); + close(fd); + cui_packet_free(p); + return 0; +} + int command_info(){} -int main (int argc, char *argv[]) +int main (int argc, char *argv[]) { if (get_options(argc, argv)) { @@ -150,6 +166,8 @@ return command_uri(); } else if (!strcmp(opts.command, "info")) { return command_info(); + } else if (!strcmp(opts.command, "quit")) { + return command_quit(); } else { show_remote_usage(argv[0]); return 1;