# HG changeset patch # User Christian Hammond # Date 1058424110 0 # Node ID 73f8f5c0e348946dbd6b6d6e5ee554fecae69c78 # Parent aa806c22fb400d3fda199a8faceb9bbc5dc39e53 [gaim-migrate @ 6662] This should fix the bug where loading the Remote Control plugin was causing duplicate stuff in the buddy list. committer: Tailor Script diff -r aa806c22fb40 -r 73f8f5c0e348 plugins/gaim-remote/remote.c --- a/plugins/gaim-remote/remote.c Thu Jul 17 06:26:54 2003 +0000 +++ b/plugins/gaim-remote/remote.c Thu Jul 17 06:41:50 2003 +0000 @@ -657,69 +657,46 @@ } #endif /*! _WIN32*/ -static int -core_main() +static gboolean +plugin_load(GaimPlugin *plugin) { - /* - GMainLoop *loop; - */ #ifndef _WIN32 GIOChannel *channel; -#endif - gaim_set_blist(gaim_blist_new()); - gaim_blist_load(); - -#ifndef _WIN32 - - UI_fd = open_socket(); - if (UI_fd < 0) - return 1; + if ((UI_fd = open_socket()) < 0) + return FALSE; channel = g_io_channel_unix_new(UI_fd); watcher = g_io_add_watch(channel, G_IO_IN, socket_readable, NULL); g_io_channel_unref(channel); + + return TRUE; +#else + return FALSE; #endif - - /* - loop = g_main_new(TRUE); - g_main_run(loop); - */ - - return 0; } -static void -core_quit() +static gboolean +plugin_unload(GaimPlugin *plugin) { /* don't save prefs after plugins are gone... */ #ifndef _WIN32 char buf[1024]; + g_source_remove(watcher); close(UI_fd); + g_snprintf(buf, sizeof(buf), "%s" G_DIR_SEPARATOR_S "gaim_%s.%d", g_get_tmp_dir(), g_get_user_name(), gaim_session); unlink(buf); gaim_debug(GAIM_DEBUG_MISC, "core", "Removed core\n"); -#endif -} - -static gboolean -plugin_load(GaimPlugin *plugin) -{ - core_main(); return TRUE; -} - -static gboolean -plugin_unload(GaimPlugin *plugin) -{ - core_quit(); - - return TRUE; +#else + return FALSE; +#endif } static GaimPluginInfo info = @@ -755,4 +732,5 @@ { } +/* This may be horribly wrong. Oh the mayhem! */ GAIM_INIT_PLUGIN(remote, __init_plugin, info)