void twitter_conv_icon_account_load(PurpleAccount * account) { PurpleConnection *gc = purple_account_get_connection(account); TwitterConnectionData *twitter = gc->proto_data; twitter->icons = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, (GDestroyNotify) twitter_conv_icon_free); purple_signal_connect(pidgin_conversations_get_handle(), "displaying-chat-msg", twitter->icons, PURPLE_CALLBACK(twitter_conv_icon_displaying_chat_cb), account); purple_signal_connect(pidgin_conversations_get_handle(), "displayed-chat-msg", twitter->icons, PURPLE_CALLBACK(twitter_conv_icon_displayed_chat_cb), account); purple_signal_connect(purple_conversations_get_handle(), "conversation-created", twitter->icons, PURPLE_CALLBACK(twitter_conv_icon_conversation_created_cb), account); purple_signal_connect(purple_conversations_get_handle(), "deleting-conversation", twitter->icons, PURPLE_CALLBACK(twitter_conv_icon_deleting_conversation_cb), account); }
static gboolean plugin_load(PurplePlugin* plugin) { purple_signal_connect(pidgin_conversations_get_handle(), "chat-nick-clicked", plugin, PURPLE_CALLBACK(conversation_nick_clicked), NULL); return TRUE; }
static void hide_conv(PidginConversation *gtkconv, gboolean closetimer) { GList *list; purple_signal_emit(pidgin_conversations_get_handle(), "conversation-hiding", gtkconv); for (list = g_list_copy(gtkconv->convs); list; list = g_list_delete_link(list, list)) { PurpleConversation *conv = list->data; if (closetimer) { guint timer = GPOINTER_TO_INT(purple_conversation_get_data(conv, "close-timer")); if (timer) purple_timeout_remove(timer); timer = purple_timeout_add_seconds(CLOSE_CONV_TIMEOUT_SECS, close_already, conv); purple_conversation_set_data(conv, "close-timer", GINT_TO_POINTER(timer)); } #if 0 /* I will miss you */ purple_conversation_set_ui_ops(conv, NULL); #else pidgin_conv_window_remove_gtkconv(gtkconv->win, gtkconv); pidgin_conv_window_add_gtkconv(hidden_convwin, gtkconv); #endif } }
/************************************************************************************************** Load plugin **************************************************************************************************/ static gboolean plugin_load(PurplePlugin *plugin) { PidginBuddyList *gtkblist = pidgin_blist_get_default_gtk_blist(); GList *convs = purple_get_conversations(); if (purple_prefs_get_bool("/plugins/core/hidemenu/default_state")) { hmb_is_menu_visible = FALSE; } else { hmb_is_menu_visible = TRUE; } // set callback for 'blist created' signal purple_signal_connect(pidgin_blist_get_handle(), "gtkblist-created", plugin, PURPLE_CALLBACK(hmb_blist_created_cb), NULL); // set callback for 'conversation displayed' signal purple_signal_connect(pidgin_conversations_get_handle(), "conversation-displayed", plugin, PURPLE_CALLBACK(hmb_conversation_displayed_cb), NULL); // hide blist menubar hmb_toggle_menubar(gtkblist, NULL); // hide conversations menubar while (convs) { PurpleConversation *conv = (PurpleConversation *)convs->data; if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) { hmb_toggle_menubar(NULL, PIDGIN_CONVERSATION(conv)); } convs = convs->next; } return TRUE; }
static gboolean plugin_load(PurplePlugin *plugin, GError **error) { void *accounts_handle = pidgin_accounts_get_handle(); void *blist_handle = pidgin_blist_get_handle(); void *conv_handle = pidgin_conversations_get_handle(); /* Accounts subsystem signals */ purple_signal_connect(accounts_handle, "account-modified", plugin, PURPLE_CALLBACK(account_modified_cb), NULL); /* Buddy List subsystem signals */ purple_signal_connect(blist_handle, "gtkblist-created", plugin, PURPLE_CALLBACK(blist_created_cb), NULL); purple_signal_connect(blist_handle, "drawing-tooltip", plugin, PURPLE_CALLBACK(blist_drawing_tooltip_cb), NULL); /* Conversations subsystem signals */ purple_signal_connect(conv_handle, "conversation-dragging", plugin, PURPLE_CALLBACK(conversation_dragging_cb), NULL); purple_signal_connect(conv_handle, "displaying-im-msg", plugin, PURPLE_CALLBACK(displaying_im_msg_cb), NULL); purple_signal_connect(conv_handle, "displayed-im-msg", plugin, PURPLE_CALLBACK(displayed_im_msg_cb), NULL); purple_signal_connect(conv_handle, "displaying-chat-msg", plugin, PURPLE_CALLBACK(displaying_chat_msg_cb), NULL); purple_signal_connect(conv_handle, "displayed-chat-msg", plugin, PURPLE_CALLBACK(displayed_chat_msg_cb), NULL); purple_signal_connect(conv_handle, "conversation-switched", plugin, PURPLE_CALLBACK(conversation_switched_cb), NULL); return TRUE; }
/* * EXPORTED FUNCTIONS */ static gboolean plugin_load(PurplePlugin *plugin) { purple_signal_connect(purple_conversations_get_handle(), "conversation-created", plugin, PURPLE_CALLBACK(new_conversation_cb), NULL); /* Set callback to remove window from the list, if the window is destroyed */ purple_signal_connect(purple_conversations_get_handle(), "deleting-conversation", plugin, PURPLE_CALLBACK(conversation_delete_cb), NULL); purple_signal_connect(pidgin_conversations_get_handle(), "conversation-dragging", plugin, PURPLE_CALLBACK(set_conv_window_trans), NULL); purple_signal_connect(purple_conversations_get_handle(), "conversation-updated", plugin, PURPLE_CALLBACK(conv_updated_cb), NULL); update_existing_convs(); if (blist) blist_created_cb(NULL, NULL); else purple_signal_connect(pidgin_blist_get_handle(), "gtkblist-created", plugin, PURPLE_CALLBACK(blist_created_cb), NULL); return TRUE; }
static gboolean plugin_load(PurplePlugin *plugin, GError **error) { GList *convs = purple_conversations_get_all(); void *gtk_conv_handle = pidgin_conversations_get_handle(); purple_signal_connect(gtk_conv_handle, "conversation-displayed", plugin, PURPLE_CALLBACK(conversation_displayed_cb), NULL); /* purple_signal_connect(gtk_conv_handle, "conversation-hiding", plugin, PURPLE_CALLBACK(conversation_hiding_cb), NULL); */ while (convs) { PurpleConversation *conv = (PurpleConversation *)convs->data; /* Setup Send button */ if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) { create_send_button_pidgin(PIDGIN_CONVERSATION(conv)); } convs = convs->next; } return TRUE; }
static gboolean plugin_load(PurplePlugin *plugin, GError **error) { GList *convs = purple_conversations_get_all(); PurpleSavedStatus *saved_status; void *conv_handle = purple_conversations_get_handle(); void *gtk_conv_handle = pidgin_conversations_get_handle(); void *savedstat_handle = purple_savedstatuses_get_handle(); purple_prefs_add_none("/plugins/gtk"); purple_prefs_add_none("/plugins/gtk/unity"); purple_prefs_add_int("/plugins/gtk/unity/launcher_count", LAUNCHER_COUNT_SOURCES); purple_prefs_add_int("/plugins/gtk/unity/messaging_menu_text", MESSAGING_MENU_COUNT); purple_prefs_add_bool("/plugins/gtk/unity/alert_chat_nick", TRUE); alert_chat_nick = purple_prefs_get_bool("/plugins/gtk/unity/alert_chat_nick"); mmapp = messaging_menu_app_new("pidgin.desktop"); g_object_ref(mmapp); messaging_menu_app_register(mmapp); messaging_menu_text = purple_prefs_get_int("/plugins/gtk/unity/messaging_menu_text"); g_signal_connect(mmapp, "activate-source", G_CALLBACK(message_source_activated), NULL); g_signal_connect(mmapp, "status-changed", G_CALLBACK(messaging_menu_status_changed), NULL); saved_status = purple_savedstatus_get_current(); status_changed_cb(saved_status); purple_signal_connect(savedstat_handle, "savedstatus-changed", plugin, PURPLE_CALLBACK(status_changed_cb), NULL); launcher = unity_launcher_entry_get_for_desktop_id("pidgin.desktop"); g_object_ref(launcher); launcher_count = purple_prefs_get_int("/plugins/gtk/unity/launcher_count"); purple_signal_connect(gtk_conv_handle, "displayed-im-msg", plugin, PURPLE_CALLBACK(message_displayed_cb), NULL); purple_signal_connect(gtk_conv_handle, "displayed-chat-msg", plugin, PURPLE_CALLBACK(message_displayed_cb), NULL); purple_signal_connect(conv_handle, "sent-im-msg", plugin, PURPLE_CALLBACK(im_sent_im), NULL); purple_signal_connect(conv_handle, "sent-chat-msg", plugin, PURPLE_CALLBACK(chat_sent_im), NULL); purple_signal_connect(conv_handle, "conversation-created", plugin, PURPLE_CALLBACK(conv_created), NULL); purple_signal_connect(conv_handle, "deleting-conversation", plugin, PURPLE_CALLBACK(deleting_conv), NULL); while (convs) { PurpleConversation *conv = (PurpleConversation *)convs->data; attach_signals(conv); convs = convs->next; } return TRUE; }
static gboolean plugin_load(PurplePlugin *plugin) { purple_signal_connect(pidgin_conversations_get_handle(), "conversation-timestamp", plugin, PURPLE_CALLBACK(conversation_timestamp_cb), NULL); purple_signal_connect(purple_log_get_handle(), "log-timestamp", plugin, PURPLE_CALLBACK(log_timestamp_cb), NULL); return TRUE; }
static gboolean plugin_load(PurplePlugin *plugin) { attach_to_all_windows(); purple_signal_connect(pidgin_conversations_get_handle(), "conversation-displayed", plugin, PURPLE_CALLBACK(conv_created), NULL); purple_signal_connect(purple_conversations_get_handle(), "conversation-extended-menu", plugin, PURPLE_CALLBACK(conv_menu_cb), NULL); return TRUE; }
/** * The plugin's load function * * @param[in] plugin Pointer to the plugin * @return Whether to continue loading **/ static gboolean plugin_load(PurplePlugin *plugin) { PidginBuddyList * gtkblist; /*< For determining if blist was initialized */ void *conv_handle; /*< The conversations handle */ void *gtkblist_handle; /*< The Pidgin Buddy List handle */ void *gtkconv_handle; /*< The Pidgin conversations handle */ /* XXX: There should be an interface to list available Buddy List * windows. */ gtkblist = pidgin_blist_get_default_gtk_blist(); conv_handle = purple_conversations_get_handle(); gtkblist_handle = pidgin_blist_get_handle(); gtkconv_handle = pidgin_conversations_get_handle(); /* Add the conversation placement option provided by this plugin. */ pidgin_conv_placement_add_fnc(PLUGIN_TOKEN, _(PWM_STR_CP_BLIST), &conv_placement_by_blist); purple_prefs_trigger_callback(PIDGIN_PREFS_ROOT "/conversations/placement"); /* Rebuild the layout when the preference changes. */ purple_prefs_connect_callback(plugin, PREF_SIDE, pref_convs_side_cb, NULL); /* Toggle the instruction panel as conversations come and go. */ purple_signal_connect(conv_handle, "conversation-created", plugin, PURPLE_CALLBACK(conversation_created_cb), NULL); purple_signal_connect(conv_handle, "deleting-conversation", plugin, PURPLE_CALLBACK(deleting_conversation_cb), NULL); purple_signal_connect(gtkconv_handle, "conversation-dragging", plugin, PURPLE_CALLBACK(conversation_dragging_cb), NULL); purple_signal_connect(gtkconv_handle, "conversation-hiding", plugin, PURPLE_CALLBACK(conversation_hiding_cb), NULL); purple_signal_connect(gtkconv_handle, "conversation-switched", plugin, PURPLE_CALLBACK(conversation_switched_cb), NULL); /* Hijack Buddy Lists as they are created. */ purple_signal_connect(gtkblist_handle, "gtkblist-created", plugin, PURPLE_CALLBACK(gtkblist_created_cb), NULL); /* If a default Buddy List is already available, use it immediately. */ if (gtkblist != NULL && gtkblist->window != NULL) pwm_merge_conversation(gtkblist); return TRUE; }
static gboolean plugin_load(PurplePlugin *plugin, GError **error) { purple_prefs_add_none("/plugins/gtk/win32"); purple_prefs_add_none("/plugins/gtk/win32/wintrans"); purple_prefs_add_bool(OPT_WINTRANS_IM_ENABLED, FALSE); purple_prefs_add_int(OPT_WINTRANS_IM_ALPHA, 255); purple_prefs_add_bool(OPT_WINTRANS_IM_SLIDER, FALSE); purple_prefs_add_bool(OPT_WINTRANS_IM_ONFOCUS, FALSE); purple_prefs_add_bool(OPT_WINTRANS_IM_ONTOP, FALSE); purple_prefs_add_bool(OPT_WINTRANS_BL_ENABLED, FALSE); purple_prefs_add_int(OPT_WINTRANS_BL_ALPHA, 255); purple_prefs_add_bool(OPT_WINTRANS_BL_ONFOCUS, FALSE); purple_prefs_add_bool(OPT_WINTRANS_BL_ONTOP, FALSE); purple_signal_connect(purple_conversations_get_handle(), "conversation-created", plugin, PURPLE_CALLBACK(new_conversation_cb), NULL); /* Set callback to remove window from the list, if the window is destroyed */ purple_signal_connect(purple_conversations_get_handle(), "deleting-conversation", plugin, PURPLE_CALLBACK(conversation_delete_cb), NULL); purple_signal_connect(pidgin_conversations_get_handle(), "conversation-dragging", plugin, PURPLE_CALLBACK(set_conv_window_trans), NULL); purple_signal_connect(purple_conversations_get_handle(), "conversation-updated", plugin, PURPLE_CALLBACK(conv_updated_cb), NULL); update_existing_convs(); if (blist) blist_created_cb(NULL, NULL); else purple_signal_connect(pidgin_blist_get_handle(), "gtkblist-created", plugin, PURPLE_CALLBACK(blist_created_cb), NULL); return TRUE; }
static gboolean plugin_load(PurplePlugin *plugin) { void *conv_handle = purple_conversations_get_handle(); void *gtkconv_handle = pidgin_conversations_get_handle(); /* lower priority to display initial timestamp after logged messages */ purple_signal_connect_priority(conv_handle, "conversation-created", plugin, PURPLE_CALLBACK(timestamp_new_convo), NULL, PURPLE_SIGNAL_PRIORITY_DEFAULT + 1); purple_signal_connect(gtkconv_handle, "displaying-chat-msg", plugin, PURPLE_CALLBACK(timestamp_displaying_conv_msg), NULL); purple_signal_connect(gtkconv_handle, "displaying-im-msg", plugin, PURPLE_CALLBACK(timestamp_displaying_conv_msg), NULL); interval = purple_prefs_get_int("/plugins/gtk/timestamp/interval") / 1000; return TRUE; }
static gboolean plugin_load(PurplePlugin *plugin) { GList *convs = purple_get_conversations(); void *gtk_conv_handle = pidgin_conversations_get_handle(); purple_signal_connect(gtk_conv_handle, "conversation-displayed", plugin, PURPLE_CALLBACK(conversation_displayed_cb), NULL); while (convs) { PurpleConversation *conv = (PurpleConversation *)convs->data; /* Setup context menu action */ if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) { create_close_offline_menu_item_pidgin(PIDGIN_CONVERSATION(conv)); } convs = convs->next; } return TRUE; }
/* * EXPORTED FUNCTIONS */ static gboolean plugin_load(PurplePlugin *plugin) { MySetLayeredWindowAttributes = (void*) wpurple_find_and_loadproc( "user32.dll", "SetLayeredWindowAttributes"); if (!MySetLayeredWindowAttributes) { purple_debug_error(WINTRANS_PLUGIN_ID, "SetLayeredWindowAttributes API not found (Required W2K+)\n"); return FALSE; } purple_signal_connect(purple_conversations_get_handle(), "conversation-created", plugin, PURPLE_CALLBACK(new_conversation_cb), NULL); /* Set callback to remove window from the list, if the window is destroyed */ purple_signal_connect(purple_conversations_get_handle(), "deleting-conversation", plugin, PURPLE_CALLBACK(conversation_delete_cb), NULL); purple_signal_connect(pidgin_conversations_get_handle(), "conversation-dragging", plugin, PURPLE_CALLBACK(set_conv_window_trans), NULL); purple_signal_connect(purple_conversations_get_handle(), "conversation-updated", plugin, PURPLE_CALLBACK(conv_updated_cb), NULL); update_existing_convs(); if (blist) blist_created_cb(NULL, NULL); else purple_signal_connect(pidgin_blist_get_handle(), "gtkblist-created", plugin, PURPLE_CALLBACK(blist_created_cb), NULL); return TRUE; }
static gboolean plugin_load(PurplePlugin *plugin) { GList *convs = purple_get_conversations(); void *conv_handle = purple_conversations_get_handle(); void *gtk_conv_handle = pidgin_conversations_get_handle(); my_plugin = plugin; purple_signal_connect(gtk_conv_handle, "displayed-im-msg", plugin, PURPLE_CALLBACK(message_displayed_cb), NULL); purple_signal_connect(gtk_conv_handle, "displayed-chat-msg", plugin, PURPLE_CALLBACK(message_displayed_cb), NULL); purple_signal_connect(gtk_conv_handle, "conversation-switched", plugin, PURPLE_CALLBACK(conv_switched), NULL); purple_signal_connect(conv_handle, "sent-im-msg", plugin, PURPLE_CALLBACK(im_sent_im), NULL); purple_signal_connect(conv_handle, "sent-chat-msg", plugin, PURPLE_CALLBACK(chat_sent_im), NULL); purple_signal_connect(conv_handle, "conversation-created", plugin, PURPLE_CALLBACK(conv_created), NULL); purple_signal_connect(conv_handle, "deleting-conversation", plugin, PURPLE_CALLBACK(deleting_conv), NULL); #if 0 purple_signal_connect(gtk_conv_handle, "conversation-dragging", plugin, PURPLE_CALLBACK(conversation_dragging), NULL); #endif while (convs) { PurpleConversation *conv = (PurpleConversation *)convs->data; /* attach signals */ attach_signals(conv); convs = convs->next; } return TRUE; }
static gboolean unload_plugin(PurplePlugin *plugin) { int i; GList *current; twitter_debug("called\n"); /* disconnect from signal */ purple_signal_disconnect(purple_conversations_get_handle(), "writing-im-msg", plugin, PURPLE_CALLBACK(writing_im_cb)); purple_signal_disconnect(purple_conversations_get_handle(), "sending-im-msg", plugin, PURPLE_CALLBACK(sending_im_cb)); purple_signal_disconnect(purple_conversations_get_handle(), "conversation-created", plugin, PURPLE_CALLBACK(conv_created_cb)); purple_signal_disconnect(pidgin_conversations_get_handle(), "displaying-im-msg", plugin, PURPLE_CALLBACK(displaying_im_cb)); purple_signal_disconnect(pidgin_conversations_get_handle(), "displayed-im-msg", plugin, PURPLE_CALLBACK(displayed_im_cb)); purple_signal_disconnect(purple_conversations_get_handle(), "receiving-im-msg", plugin, PURPLE_CALLBACK(receiving_im_cb)); purple_signal_disconnect(purple_conversations_get_handle(), "deleting-conversation", plugin, PURPLE_CALLBACK(deleting_conv_cb)); purple_signal_disconnect(purple_connections_get_handle(), "signed-on", plugin, PURPLE_CALLBACK(signed_on_cb)); /* unreference regp */ for(i = 0; i < NUM_REGPS; i++) { g_regex_unref(regp[i]); } /* remove mark list in each hash entry */ /* cancel request that has not been finished yet */ for(i = twitter_service; i < NUM_SERVICES; i++) { /* delete mark list and stop requeset for each hash table */ g_hash_table_foreach(icon_hash[i], (GHFunc)cleanup_hash_entry_func, NULL); /* destroy hash table for icon_data */ g_hash_table_destroy(icon_hash[i]); } g_hash_table_destroy(conv_hash); /* detach from twitter window */ detach_from_window(); /* free wassr_parrot_list */ current = g_list_first(wassr_parrot_list); while(current) { GList *next; next = g_list_next(current); g_free(current->data); wassr_parrot_list = g_list_delete_link(wassr_parrot_list, current); current = next; } g_list_free(wassr_parrot_list); wassr_parrot_list = NULL; /* free identica_parot_list */ current = g_list_first(identica_parrot_list); while(current) { GList *next; next = g_list_next(current); g_free(current->data); identica_parrot_list = g_list_delete_link(identica_parrot_list, current); current = next; } g_list_free(identica_parrot_list); identica_parrot_list = NULL; return TRUE; }
static gboolean load_plugin(PurplePlugin *plugin) { int i; /* connect to signal */ purple_signal_connect(purple_conversations_get_handle(), "writing-im-msg", plugin, PURPLE_CALLBACK(writing_im_cb), NULL); purple_signal_connect(purple_conversations_get_handle(), "sending-im-msg", plugin, PURPLE_CALLBACK(sending_im_cb), NULL); purple_signal_connect(purple_conversations_get_handle(), "conversation-created", plugin, PURPLE_CALLBACK(conv_created_cb), NULL); purple_signal_connect(purple_conversations_get_handle(), "receiving-im-msg", plugin, PURPLE_CALLBACK(receiving_im_cb), NULL); purple_signal_connect(pidgin_conversations_get_handle(), "displaying-im-msg", plugin, PURPLE_CALLBACK(displaying_im_cb), NULL); purple_signal_connect(pidgin_conversations_get_handle(), "displayed-im-msg", plugin, PURPLE_CALLBACK(displayed_im_cb), NULL); purple_signal_connect(purple_conversations_get_handle(), "deleting-conversation", plugin, PURPLE_CALLBACK(deleting_conv_cb), NULL); purple_signal_connect(purple_connections_get_handle(), "signed-on", plugin, PURPLE_CALLBACK(signed_on_cb), NULL); /* compile regex */ regp[RECIPIENT] = g_regex_new(P_RECIPIENT, 0, 0, NULL); regp[SENDER] = g_regex_new(P_SENDER, 0, 0, NULL); regp[SENDER_FFEED] = g_regex_new(P_SENDER_FFEED, 0, 0, NULL); regp[COMMAND] = g_regex_new(P_COMMAND, G_REGEX_RAW, 0, NULL); regp[PSEUDO] = g_regex_new(P_PSEUDO, G_REGEX_RAW, 0, NULL); regp[USER] = g_regex_new(P_USER, 0, 0, NULL); regp[CHANNEL_WASSR] = g_regex_new(P_CHANNEL, 0, 0, NULL); regp[TAG_TWITTER] = g_regex_new(P_TAG_TWITTER, 0, 0, NULL); regp[TAG_IDENTICA] = g_regex_new(P_TAG_IDENTICA, 0, 0, NULL); regp[GROUP_IDENTICA] = g_regex_new(P_GROUP_IDENTICA, 0, 0, NULL); regp[IMAGE_TWITTER] = g_regex_new(P_IMAGE_TWITTER, 0, 0, NULL); regp[IMAGE_WASSR] = g_regex_new(P_IMAGE_WASSR, 0, 0, NULL); regp[IMAGE_IDENTICA] = g_regex_new(P_IMAGE_IDENTICA, 0, 0, NULL); regp[IMAGE_JISKO] = g_regex_new(P_IMAGE_JISKO, 0, 0, NULL); regp[IMAGE_FFEED] = g_regex_new(P_IMAGE_FFEED, 0, 0, NULL); regp[SIZE_128_WASSR] = g_regex_new(P_SIZE_128_WASSR, 0, 0, NULL); regp[EXCESS_LF] = g_regex_new(P_EXCESS_LF, 0, 0, NULL); regp[TRAIL_HASH] = g_regex_new(P_TRAIL_HASH, 0, 0, NULL); for(i = twitter_service; i < NUM_SERVICES; i++) { icon_hash[i] = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); } conv_hash = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, NULL); /* attach counter to the existing twitter window */ if(purple_prefs_get_bool(OPT_COUNTER)) { attach_to_window(); } return TRUE; }