# HG changeset patch # User Eric Warmenhoven # Date 956717399 0 # Node ID 8d8faeab01f6cd3a7d36fe88b7f228a1ae209cd8 # Parent 5d62a5d50c89a38aac74888cd4d59306424bbfdd [gaim-migrate @ 189] Added a TOC interface plugin. committer: Tailor Script diff -r 5d62a5d50c89 -r 8d8faeab01f6 plugins/Makefile.am --- a/plugins/Makefile.am Wed Apr 26 01:29:21 2000 +0000 +++ b/plugins/Makefile.am Wed Apr 26 02:49:59 2000 +0000 @@ -10,4 +10,4 @@ plugin_DATA = autorecon.so iconaway.so spellchk.so plugindir = $(libdir)/gaim EXTRA_DIST = CRAZY HOWTO SIGNALS autorecon.c chkmail.c filectl.c gaiminc.c \ - iconaway.c simple.c spellchk.c + iconaway.c simple.c spellchk.c toc_commands.c diff -r 5d62a5d50c89 -r 8d8faeab01f6 plugins/filectl.c --- a/plugins/filectl.c Wed Apr 26 01:29:21 2000 +0000 +++ b/plugins/filectl.c Wed Apr 26 02:49:59 2000 +0000 @@ -9,12 +9,12 @@ #include #include -void *handle; -int check; -time_t mtime; +static void *handle; +static int check; +static time_t mtime; -void init_file(); -void check_file(); +static void init_file(); +static void check_file(); extern void dologin(GtkWidget *, GtkWidget *); extern void do_quit(); @@ -36,7 +36,8 @@ while (fgets(buffer, sizeof buffer, file)) { if (buffer[strlen(buffer) - 1] == '\n') buffer[strlen(buffer) - 1] = 0; - printf("read: %s\n", buffer); + sprintf(debug_buff, "read: %s\n", buffer); + debug_print(debug_buff); command = getarg(buffer, 0, 0); if (!strncasecmp(command, "signon", 6)) { if (!blist) { @@ -116,8 +117,11 @@ sprintf(file, "%s/.gaim/control", getenv("HOME")); if ((stat (file, &finfo) == 0) && (finfo.st_size > 0)) - if (mtime != finfo.st_mtime) + if (mtime != finfo.st_mtime) { + sprintf(debug_buff, "control changed, checking\n"); + debug_print(debug_buff); run_commands(); + } } char *getarg(char *line, int which, int remain) { diff -r 5d62a5d50c89 -r 8d8faeab01f6 plugins/toc_commands.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/toc_commands.c Wed Apr 26 02:49:59 2000 +0000 @@ -0,0 +1,39 @@ +#define GAIM_PLUGINS +#include "gaim.h" + +#include + +void enter_callback(GtkWidget *widget, GtkWidget *entry) { + gchar *entry_text; + entry_text = gtk_entry_get_text(GTK_ENTRY(entry)); + sflap_send(entry_text, strlen(entry_text), TYPE_DATA); +} + +GtkWidget *window; +void gaim_plugin_init(void *h) { + GtkWidget *entry; + + window = gtk_window_new(GTK_WINDOW_DIALOG); + gtk_window_set_title(GTK_WINDOW(window), "Gaim - SFLAP interface"); + + entry = gtk_entry_new(); + gtk_signal_connect(GTK_OBJECT(entry), "activate", + (GtkSignalFunc)enter_callback, + entry); + gtk_container_add(GTK_CONTAINER(window), entry); + gtk_widget_show(entry); + + gtk_widget_show(window); +} + +void gaim_plugin_remove() { + gtk_widget_destroy(window); +} + +char *name() { + return "TOC Interface"; +} + +char *description() { + return "Allows you to talk directly to the TOC server, bypassing gaim."; +}