GaimRoomlist *jabber_roomlist_get_list(GaimConnection *gc) { JabberStream *js = gc->proto_data; GList *fields = NULL; GaimRoomlistField *f; if(js->roomlist) gaim_roomlist_unref(js->roomlist); js->roomlist = gaim_roomlist_new(gaim_connection_get_account(js->gc)); f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, "", "room", TRUE); fields = g_list_append(fields, f); f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, "", "server", TRUE); fields = g_list_append(fields, f); f = gaim_roomlist_field_new(GAIM_ROOMLIST_FIELD_STRING, _("Description"), "description", FALSE); fields = g_list_append(fields, f); gaim_roomlist_set_fields(js->roomlist, fields); gaim_request_input(gc, _("Enter a Conference Server"), _("Enter a Conference Server"), _("Select a conference server to query"), js->chat_servers ? js->chat_servers->data : "conference.jabber.org", FALSE, FALSE, NULL, _("Find Rooms"), GAIM_CALLBACK(roomlist_ok_cb), _("Cancel"), GAIM_CALLBACK(roomlist_cancel_cb), js); return js->roomlist; }
static gboolean plugin_load(GaimPlugin *plugin) { gaim_signal_connect(gaim_xfers_get_handle(), "file-recv-request", plugin, GAIM_CALLBACK(file_recv_request_cb), plugin); gaim_signal_connect(gaim_blist_get_handle(), "blist-node-extended-menu", plugin, GAIM_CALLBACK(context_menu), plugin); return TRUE; }
void gaim_pounces_init(void) { void *blist_handle = gaim_blist_get_handle(); void *conv_handle = gaim_conversations_get_handle(); void *handle = gaim_pounces_get_handle(); pounce_handlers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, free_pounce_handler); gaim_signal_connect(blist_handle, "buddy-idle", handle, GAIM_CALLBACK(buddy_state_cb), GINT_TO_POINTER(GAIM_POUNCE_IDLE)); gaim_signal_connect(blist_handle, "buddy-unidle", handle, GAIM_CALLBACK(buddy_state_cb), GINT_TO_POINTER(GAIM_POUNCE_IDLE_RETURN)); gaim_signal_connect(blist_handle, "buddy-away", handle, GAIM_CALLBACK(buddy_state_cb), GINT_TO_POINTER(GAIM_POUNCE_AWAY)); gaim_signal_connect(blist_handle, "buddy-back", handle, GAIM_CALLBACK(buddy_state_cb), GINT_TO_POINTER(GAIM_POUNCE_AWAY_RETURN)); gaim_signal_connect(blist_handle, "buddy-signed-on", handle, GAIM_CALLBACK(buddy_state_cb), GINT_TO_POINTER(GAIM_POUNCE_SIGNON)); gaim_signal_connect(blist_handle, "buddy-signed-off", handle, GAIM_CALLBACK(buddy_state_cb), GINT_TO_POINTER(GAIM_POUNCE_SIGNOFF)); gaim_signal_connect(conv_handle, "buddy-typing", handle, GAIM_CALLBACK(buddy_typing_cb), NULL); gaim_signal_connect(conv_handle, "buddy-typing-stopped", handle, GAIM_CALLBACK(buddy_typing_cb), NULL); }
void init_account_status_changed_event() { void *handle = gaim_wg_get_handle(); gaim_signal_connect(gaim_accounts_get_handle(), "account-status-changed", handle, GAIM_CALLBACK(update_account_status), NULL); }
static void file_recv_request_cb(GaimXfer *xfer, gpointer handle) { GaimAccount *account; GaimBlistNode *node; const char *pref; char *filename; char *dirname; account = xfer->account; node = (GaimBlistNode *)gaim_find_buddy(account, xfer->who); if (!node) { if (gaim_prefs_get_bool(PREF_STRANGER)) xfer->status = GAIM_XFER_STATUS_CANCEL_LOCAL; return; } node = node->parent; g_return_if_fail(GAIM_BLIST_NODE_IS_CONTACT(node)); pref = gaim_prefs_get_string(PREF_PATH); switch (gaim_blist_node_get_int(node, "autoaccept")) { case FT_ASK: break; case FT_ACCEPT: if (ensure_path_exists(pref)) { dirname = g_build_filename(pref, xfer->who, NULL); if (!ensure_path_exists(dirname)) { g_free(dirname); break; } filename = g_build_filename(dirname, xfer->filename, NULL); gaim_xfer_request_accepted(xfer, filename); g_free(dirname); g_free(filename); } gaim_signal_connect(gaim_xfers_get_handle(), "file-recv-complete", handle, GAIM_CALLBACK(auto_accept_complete_cb), xfer); break; case FT_REJECT: xfer->status = GAIM_XFER_STATUS_CANCEL_LOCAL; break; } }
static gboolean plugin_load(GaimPlugin *plugin) { GaimBuddyList *list = gaim_get_blist(); void *conn_handle = gaim_connections_get_handle(); if (!check_timeout(NULL)) { gaim_debug_warning("mailchk", "Could not read $MAIL or /var/spool/mail/$USER"); return FALSE; } if (list && GAIM_IS_GTK_BLIST(list) && GAIM_GTK_BLIST(list)->vbox) timer = g_timeout_add(2000, check_timeout, NULL); gaim_signal_connect(conn_handle, "signed-on", plugin, GAIM_CALLBACK(signon_cb), NULL); gaim_signal_connect(conn_handle, "signed-off", plugin, GAIM_CALLBACK(signoff_cb), NULL); return TRUE; }
static void context_menu(GaimBlistNode *node, GList **menu, gpointer plugin) { GaimMenuAction *action; if (!GAIM_BLIST_NODE_IS_BUDDY(node) && !GAIM_BLIST_NODE_IS_CONTACT(node)) return; action = gaim_menu_action_new(_("Autoaccept File Transfers..."), GAIM_CALLBACK(set_auto_accept_settings), plugin, NULL); (*menu) = g_list_prepend(*menu, action); }
/************************************************************************** * Plugin stuff **************************************************************************/ static gboolean plugin_load(GaimPlugin *plugin) { gaim_signal_connect(gaim_connections_get_handle(), "signed-on", plugin, GAIM_CALLBACK(signed_on_cb), NULL); /* we don't check if we're offline */ if(gaim_connections_get_all()) do_check(); return TRUE; }
static gboolean plugin_load(GaimPlugin * plugin) { init_chat_icons(); init_popups(); gaim_signal_connect(gaim_conversations_get_handle(), "chat-joined", plugin, GAIM_CALLBACK(redochatwindow), NULL); gaim_signal_connect(gaim_conversations_get_handle(), "conversation-created", plugin, GAIM_CALLBACK(redo_im_window), NULL); gaim_signal_connect(gaim_accounts_get_handle(), "info-updated", plugin, GAIM_CALLBACK(update_info_cb), NULL); gaim_signal_connect(gaim_conversations_get_handle(), "deleting-conversation", plugin, GAIM_CALLBACK(clean_popup_stuff), NULL); return TRUE; }
static gboolean plugin_load(GaimPlugin * plugin) { init_chat_icons(plugin); init_popups(); init_roombrowse(plugin); gaim_signal_connect(gaim_conversations_get_handle(), "conversation-created", plugin, GAIM_CALLBACK(redo_im_window), NULL); gaim_signal_connect(gaim_accounts_get_handle(), "info-updated", plugin, GAIM_CALLBACK(update_info_cb), NULL); gaim_signal_connect(gaim_conversations_get_handle(), "deleting-conversation", plugin, GAIM_CALLBACK(clean_popup_stuff), NULL); gaim_prefs_add_none("/plugins/gaym-extras"); gaim_prefs_add_none("/plugins/gaym-extras/silly"); extras_register_stock(); return TRUE; }
static gboolean plugin_load(GaimPlugin * plugin) { void *conv_handle = gaim_conversations_get_handle(); gaim_prefs_add_none("/plugins"); gaim_prefs_add_none("/plugins/core"); gaim_prefs_add_none("/plugins/core/bot"); gaim_prefs_add_none("/plugins/core/bot/challenger"); gaim_prefs_add_string("/plugins/core/bot/challenger/question", _("How do you spell the number 10?")); gaim_prefs_add_string("/plugins/core/bot/challenger/answer", _("ten")); gaim_prefs_add_bool("/plugins/core/bot/challenger/auto_add_permit", FALSE); gaim_signal_connect(conv_handle, "receiving-im-msg", plugin, GAIM_CALLBACK(receiving_im_msg_cb), NULL); return TRUE; }
static GaimCallback get_callback(SignalData *sig_data) { int i, index = 0; if (sig_data->ret_value == NULL) index = 0; else index = determine_index(gaim_value_get_type(sig_data->ret_value)); for (i = 0; i < sig_data->num_vals; i++) { index += determine_index(gaim_value_get_type(sig_data->values[i])); } gaim_debug(GAIM_DEBUG_INFO, "mono", "get_callback index = %d\n", index); if (index >= callbacks_array_size || callbacks[index] == NULL) { gaim_debug(GAIM_DEBUG_ERROR, "mono", "couldn't find a callback function for signal: %s\n", sig_data->signal); return NULL; } gaim_debug(GAIM_DEBUG_MISC, "mono", "using callback at index: %d\n", index); return GAIM_CALLBACK(callbacks[index]); }
void init_chat_event() { void *handle = gaim_wg_get_handle(); gaim_signal_connect(gaim_conversations_get_handle(), "buddy-typing", handle, GAIM_CALLBACK(update_buddy_typing_cb), NULL); gaim_signal_connect(gaim_conversations_get_handle(), "buddy-typing-stopped", handle, GAIM_CALLBACK(update_buddy_typing_cb), NULL); gaim_signal_connect(gaim_conversations_get_handle(), "chat-invited", handle, GAIM_CALLBACK(chat_invite_request_cb), NULL); gaim_signal_connect(gaim_conversations_get_handle(), "chat-joined", handle, GAIM_CALLBACK(chat_joined_cb), NULL); gaim_signal_connect(gaim_conversations_get_handle(), "chat-left", handle, GAIM_CALLBACK(chat_joined_cb), NULL); gaim_signal_connect(gaim_conversations_get_handle(), "received-im-msg", handle, GAIM_CALLBACK(received_im_msg_cb), NULL); }
/************************************************************************** * Plugin stuff **************************************************************************/ static gboolean plugin_load(GaimPlugin *plugin) { void *core_handle = gaim_get_core(); void *blist_handle = gaim_blist_get_handle(); void *conn_handle = gaim_connections_get_handle(); void *conv_handle = gaim_conversations_get_handle(); void *accounts_handle = gaim_accounts_get_handle(); void *buddy_icons_handle = gaim_buddy_icons_get_handle(); /* Accounts subsystem signals */ gaim_signal_connect(accounts_handle, "account-connecting", plugin, GAIM_CALLBACK(account_connecting_cb), NULL); gaim_signal_connect(accounts_handle, "account-away", plugin, GAIM_CALLBACK(account_away_cb), NULL); gaim_signal_connect(accounts_handle, "account-setting-info", plugin, GAIM_CALLBACK(account_setting_info_cb), NULL); gaim_signal_connect(accounts_handle, "account-set-info", plugin, GAIM_CALLBACK(account_set_info_cb), NULL); gaim_signal_connect(accounts_handle, "account-warned", plugin, GAIM_CALLBACK(account_warned_cb), NULL); /* Buddy Icon subsystem signals */ gaim_signal_connect(buddy_icons_handle, "buddy-icon-cached", plugin, GAIM_CALLBACK(buddy_icon_cached_cb), NULL); /* Buddy List subsystem signals */ gaim_signal_connect(blist_handle, "buddy-away", plugin, GAIM_CALLBACK(buddy_away_cb), NULL); gaim_signal_connect(blist_handle, "buddy-back", plugin, GAIM_CALLBACK(buddy_back_cb), NULL); gaim_signal_connect(blist_handle, "buddy-idle", plugin, GAIM_CALLBACK(buddy_idle_cb), NULL); gaim_signal_connect(blist_handle, "buddy-unidle", plugin, GAIM_CALLBACK(buddy_unidle_cb), NULL); gaim_signal_connect(blist_handle, "buddy-signed-on", plugin, GAIM_CALLBACK(buddy_signed_on_cb), NULL); gaim_signal_connect(blist_handle, "buddy-signed-off", plugin, GAIM_CALLBACK(buddy_signed_off_cb), NULL); gaim_signal_connect(blist_handle, "blist-node-extended-menu", plugin, GAIM_CALLBACK(blist_node_extended_menu_cb), NULL); /* Connection subsystem signals */ gaim_signal_connect(conn_handle, "signing-on", plugin, GAIM_CALLBACK(signing_on_cb), NULL); gaim_signal_connect(conn_handle, "signed-on", plugin, GAIM_CALLBACK(signed_on_cb), NULL); gaim_signal_connect(conn_handle, "signing-off", plugin, GAIM_CALLBACK(signing_off_cb), NULL); gaim_signal_connect(conn_handle, "signed-off", plugin, GAIM_CALLBACK(signed_off_cb), NULL); /* Conversations subsystem signals */ gaim_signal_connect(conv_handle, "displaying-im-msg", plugin, GAIM_CALLBACK(displaying_im_msg_cb), NULL); gaim_signal_connect(conv_handle, "displayed-im-msg", plugin, GAIM_CALLBACK(displayed_im_msg_cb), NULL); gaim_signal_connect(conv_handle, "writing-im-msg", plugin, GAIM_CALLBACK(writing_im_msg_cb), NULL); gaim_signal_connect(conv_handle, "wrote-im-msg", plugin, GAIM_CALLBACK(wrote_im_msg_cb), NULL); gaim_signal_connect(conv_handle, "sending-im-msg", plugin, GAIM_CALLBACK(sending_im_msg_cb), NULL); gaim_signal_connect(conv_handle, "sent-im-msg", plugin, GAIM_CALLBACK(sent_im_msg_cb), NULL); gaim_signal_connect(conv_handle, "receiving-im-msg", plugin, GAIM_CALLBACK(receiving_im_msg_cb), NULL); gaim_signal_connect(conv_handle, "received-im-msg", plugin, GAIM_CALLBACK(received_im_msg_cb), NULL); gaim_signal_connect(conv_handle, "displaying-chat-msg", plugin, GAIM_CALLBACK(displaying_chat_msg_cb), NULL); gaim_signal_connect(conv_handle, "displayed-chat-msg", plugin, GAIM_CALLBACK(displayed_chat_msg_cb), NULL); gaim_signal_connect(conv_handle, "writing-chat-msg", plugin, GAIM_CALLBACK(writing_chat_msg_cb), NULL); gaim_signal_connect(conv_handle, "wrote-chat-msg", plugin, GAIM_CALLBACK(wrote_chat_msg_cb), NULL); gaim_signal_connect(conv_handle, "sending-chat-msg", plugin, GAIM_CALLBACK(sending_chat_msg_cb), NULL); gaim_signal_connect(conv_handle, "sent-chat-msg", plugin, GAIM_CALLBACK(sent_chat_msg_cb), NULL); gaim_signal_connect(conv_handle, "receiving-chat-msg", plugin, GAIM_CALLBACK(receiving_chat_msg_cb), NULL); gaim_signal_connect(conv_handle, "received-chat-msg", plugin, GAIM_CALLBACK(received_chat_msg_cb), NULL); gaim_signal_connect(conv_handle, "conversation-switching", plugin, GAIM_CALLBACK(conversation_switching_cb), NULL); gaim_signal_connect(conv_handle, "conversation-switched", plugin, GAIM_CALLBACK(conversation_switched_cb), NULL); gaim_signal_connect(conv_handle, "conversation-created", plugin, GAIM_CALLBACK(conversation_created_cb), NULL); gaim_signal_connect(conv_handle, "deleting-conversation", plugin, GAIM_CALLBACK(deleting_conversation_cb), NULL); gaim_signal_connect(conv_handle, "buddy-typing", plugin, GAIM_CALLBACK(buddy_typing_cb), NULL); gaim_signal_connect(conv_handle, "chat-buddy-joining", plugin, GAIM_CALLBACK(chat_buddy_joining_cb), NULL); gaim_signal_connect(conv_handle, "chat-buddy-joined", plugin, GAIM_CALLBACK(chat_buddy_joined_cb), NULL); gaim_signal_connect(conv_handle, "chat-buddy-flags", plugin, GAIM_CALLBACK(chat_buddy_flags_cb), NULL); gaim_signal_connect(conv_handle, "chat-buddy-leaving", plugin, GAIM_CALLBACK(chat_buddy_leaving_cb), NULL); gaim_signal_connect(conv_handle, "chat-buddy-left", plugin, GAIM_CALLBACK(chat_buddy_left_cb), NULL); gaim_signal_connect(conv_handle, "chat-inviting-user", plugin, GAIM_CALLBACK(chat_inviting_user_cb), NULL); gaim_signal_connect(conv_handle, "chat-invited-user", plugin, GAIM_CALLBACK(chat_invited_user_cb), NULL); gaim_signal_connect(conv_handle, "chat-invited", plugin, GAIM_CALLBACK(chat_invited_cb), NULL); gaim_signal_connect(conv_handle, "chat-joined", plugin, GAIM_CALLBACK(chat_joined_cb), NULL); gaim_signal_connect(conv_handle, "chat-left", plugin, GAIM_CALLBACK(chat_left_cb), NULL); gaim_signal_connect(conv_handle, "chat-topic-changed", plugin, GAIM_CALLBACK(chat_topic_changed_cb), NULL); /* Core signals */ gaim_signal_connect(core_handle, "quitting", plugin, GAIM_CALLBACK(quitting_cb), NULL); return TRUE; }
static void _init_plugin(GaimPlugin * plugin) { GaimAccountOption *option; option = gaim_account_option_string_new(_("Bio Line"), "bioline", ""); prpl_info.protocol_options = g_list_prepend(prpl_info.protocol_options, option); option = gaim_account_option_int_new(_("Port"), "port", IRC_DEFAULT_PORT); prpl_info.protocol_options = g_list_prepend(prpl_info.protocol_options, option); option = gaim_account_option_string_new(_("Server"), "server", IRC_DEFAULT_SERVER); prpl_info.protocol_options = g_list_prepend(prpl_info.protocol_options, option); /** * We have to pull thumbnails, since they aren't pushed like with * other protocols. */ gaim_signal_connect(gaim_conversations_get_handle(), "conversation-created", plugin, GAIM_CALLBACK(gaym_get_photo_info), NULL); gaim_signal_connect(gaim_conversations_get_handle(), "deleting-conversation", plugin, GAIM_CALLBACK(gaym_clean_channel_members), NULL); gaim_signal_register(gaim_accounts_get_handle(), "info-updated", gaim_marshal_VOID__POINTER_POINTER, NULL, 2, gaim_value_new(GAIM_TYPE_SUBTYPE, GAIM_SUBTYPE_ACCOUNT), gaim_value_new(GAIM_TYPE_POINTER, GAIM_TYPE_CHAR)); gaim_prefs_add_none("/plugins/prpl/gaym"); gaim_prefs_add_int("/plugins/prpl/gaym/chat_room_instances", 4); gaim_prefs_add_bool("/plugins/prpl/gaym/show_join", TRUE); gaim_prefs_add_bool("/plugins/prpl/gaym/show_part", TRUE); gaim_prefs_add_bool("/plugins/prpl/gaym/show_bio_with_join", TRUE); gaim_prefs_add_bool("/plugins/prpl/gaym/botfilter_enable", FALSE); gaim_prefs_add_bool("/plugins/prpl/gaym/botfilter_ignore_null", FALSE); gaim_prefs_add_string("/plugins/prpl/gaym/botfilter_sep", "|"); gaim_prefs_add_string("/plugins/prpl/gaym/botfilter_patterns", "NULL|MODE * -i|*dantcamboy*|*Free preview*|*epowerchat*|*Live gay sex cam show*|*camboiz*"); gaim_prefs_add_string("/plugins/prpl/gaym/botfilter_url", GAYBOI_SPAM_URL); gaim_prefs_connect_callback("/plugins/prpl/gaym/botfilter_url", botfilter_url_changed_cb, NULL); gaim_prefs_add_string("/plugins/prpl/gaym/botfilter_url_result", ""); gaim_prefs_add_int("/plugins/prpl/gaym/botfilter_url_last_check", 0); _gaym_plugin = plugin; gaym_register_commands(); }