| 383 */ |
383 */ |
| 384 GString *str = g_string_new("Loaded Plugins: "); |
384 GString *str = g_string_new("Loaded Plugins: "); |
| 385 const GList *plugins = purple_plugins_get_loaded(); |
385 const GList *plugins = purple_plugins_get_loaded(); |
| 386 if (plugins) { |
386 if (plugins) { |
| 387 for (; plugins; plugins = plugins->next) { |
387 for (; plugins; plugins = plugins->next) { |
| 388 str = g_string_append(str, purple_plugin_get_name(plugins->data)); |
388 GPluginPluginInfo *info = gplugin_plugin_get_info(GPLUGIN_PLUGIN(plugins->data)); |
| |
389 str = g_string_append(str, gplugin_plugin_info_get_name(info)); |
| |
390 g_object_unref(info); |
| |
391 |
| 389 if (plugins->next) |
392 if (plugins->next) |
| 390 str = g_string_append(str, ", "); |
393 str = g_string_append(str, ", "); |
| 391 } |
394 } |
| 392 } else { |
395 } else { |
| 393 str = g_string_append(str, "(none)"); |
396 str = g_string_append(str, "(none)"); |
| 555 { |
558 { |
| 556 PurplePluginProtocolInfo *prpl_info = NULL; |
559 PurplePluginProtocolInfo *prpl_info = NULL; |
| 557 PurpleConnection *gc; |
560 PurpleConnection *gc; |
| 558 |
561 |
| 559 if ((gc = purple_conversation_get_connection(conv))) |
562 if ((gc = purple_conversation_get_connection(conv))) |
| 560 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_protocol_info(gc)); |
563 prpl_info = purple_connection_get_protocol_info(gc); |
| 561 |
564 |
| 562 if ((prpl_info != NULL) && (prpl_info->options & OPT_PROTO_SLASH_COMMANDS_NATIVE)) { |
565 if ((prpl_info != NULL) && (prpl_info->options & OPT_PROTO_SLASH_COMMANDS_NATIVE)) { |
| 563 char *spaceslash; |
566 char *spaceslash; |
| 564 |
567 |
| 565 /* If the first word in the entered text has a '/' in it, then the user |
568 /* If the first word in the entered text has a '/' in it, then the user |
| 1482 g_return_if_fail(account != NULL); |
1485 g_return_if_fail(account != NULL); |
| 1483 |
1486 |
| 1484 gc = purple_account_get_connection(account); |
1487 gc = purple_account_get_connection(account); |
| 1485 g_return_if_fail(gc != NULL); |
1488 g_return_if_fail(gc != NULL); |
| 1486 |
1489 |
| 1487 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_protocol_info(gc)); |
1490 prpl_info = purple_connection_get_protocol_info(gc); |
| 1488 |
1491 |
| 1489 if (prpl_info && prpl_info->get_cb_real_name) |
1492 if (prpl_info && prpl_info->get_cb_real_name) |
| 1490 real_who = prpl_info->get_cb_real_name(gc, |
1493 real_who = prpl_info->get_cb_real_name(gc, |
| 1491 purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(conv)), who); |
1494 purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(conv)), who); |
| 1492 |
1495 |
| 1536 PurpleConnection *gc = purple_conversation_get_connection(conv); |
1539 PurpleConnection *gc = purple_conversation_get_connection(conv); |
| 1537 gchar *real_who = NULL; |
1540 gchar *real_who = NULL; |
| 1538 |
1541 |
| 1539 g_return_if_fail(gc != NULL); |
1542 g_return_if_fail(gc != NULL); |
| 1540 |
1543 |
| 1541 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_protocol_info(gc)); |
1544 prpl_info = purple_connection_get_protocol_info(gc); |
| 1542 |
1545 |
| 1543 if (prpl_info && prpl_info->get_cb_real_name) |
1546 if (prpl_info && prpl_info->get_cb_real_name) |
| 1544 real_who = prpl_info->get_cb_real_name(gc, |
1547 real_who = prpl_info->get_cb_real_name(gc, |
| 1545 purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(conv)), who); |
1548 purple_chat_conversation_get_id(PURPLE_CHAT_CONVERSATION(conv)), who); |
| 1546 |
1549 |
| 1635 gboolean is_me = FALSE; |
1638 gboolean is_me = FALSE; |
| 1636 GtkWidget *button; |
1639 GtkWidget *button; |
| 1637 PurpleBuddy *buddy = NULL; |
1640 PurpleBuddy *buddy = NULL; |
| 1638 |
1641 |
| 1639 if (gc != NULL) |
1642 if (gc != NULL) |
| 1640 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_protocol_info(gc)); |
1643 prpl_info = purple_connection_get_protocol_info(gc); |
| 1641 |
1644 |
| 1642 /* |
1645 /* |
| 1643 * If a menu already exists, destroy it before creating a new one, |
1646 * If a menu already exists, destroy it before creating a new one, |
| 1644 * thus freeing-up the memory it occupied. |
1647 * thus freeing-up the memory it occupied. |
| 1645 */ |
1648 */ |
| 2454 **************************************************************************/ |
2457 **************************************************************************/ |
| 2455 |
2458 |
| 2456 static GList *get_prpl_icon_list(PurpleAccount *account) |
2459 static GList *get_prpl_icon_list(PurpleAccount *account) |
| 2457 { |
2460 { |
| 2458 GList *l = NULL; |
2461 GList *l = NULL; |
| 2459 PurplePlugin *prpl = purple_find_protocol_info(purple_account_get_protocol_id(account)); |
2462 PurplePluginProtocolInfo *prpl_info = |
| 2460 PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
2463 purple_find_protocol_info(purple_account_get_protocol_id(account)); |
| 2461 const char *prplname = prpl_info->list_icon(account, NULL); |
2464 const char *prplname = prpl_info->list_icon(account, NULL); |
| 2462 l = g_hash_table_lookup(prpl_lists, prplname); |
2465 l = g_hash_table_lookup(prpl_lists, prplname); |
| 2463 if (l) |
2466 if (l) |
| 2464 return l; |
2467 return l; |
| 2465 |
2468 |
| 3270 } |
3273 } |
| 3271 |
3274 |
| 3272 if ((chat == NULL) && (gtkconv->webview != NULL)) { |
3275 if ((chat == NULL) && (gtkconv->webview != NULL)) { |
| 3273 GHashTable *components; |
3276 GHashTable *components; |
| 3274 PurpleAccount *account = purple_conversation_get_account(conv); |
3277 PurpleAccount *account = purple_conversation_get_account(conv); |
| 3275 PurplePlugin *prpl = purple_find_protocol_info(purple_account_get_protocol_id(account)); |
3278 PurplePluginProtocolInfo *prpl_info = |
| 3276 PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
3279 purple_find_protocol_info(purple_account_get_protocol_id(account)); |
| 3277 if (purple_account_get_connection(account) != NULL && |
3280 if (purple_account_get_connection(account) != NULL && |
| 3278 PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, chat_info_defaults)) { |
3281 PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, chat_info_defaults)) { |
| 3279 components = prpl_info->chat_info_defaults(purple_account_get_connection(account), |
3282 components = prpl_info->chat_info_defaults(purple_account_get_connection(account), |
| 3280 purple_conversation_get_name(conv)); |
3283 purple_conversation_get_name(conv)); |
| 3281 } else { |
3284 } else { |
| 3392 { |
3395 { |
| 3393 GtkWidget *attention; |
3396 GtkWidget *attention; |
| 3394 GtkWidget *menu; |
3397 GtkWidget *menu; |
| 3395 PurpleConversation *conv; |
3398 PurpleConversation *conv; |
| 3396 PurpleConnection *pc; |
3399 PurpleConnection *pc; |
| 3397 PurplePlugin *prpl = NULL; |
|
| 3398 PurplePluginProtocolInfo *prpl_info = NULL; |
3400 PurplePluginProtocolInfo *prpl_info = NULL; |
| 3399 GList *list; |
3401 GList *list; |
| 3400 |
3402 |
| 3401 conv = pidgin_conv_window_get_active_conversation(win); |
3403 conv = pidgin_conv_window_get_active_conversation(win); |
| 3402 if (!conv) |
3404 if (!conv) |
| 3408 /* Remove the previous entries */ |
3410 /* Remove the previous entries */ |
| 3409 gtk_menu_item_set_submenu(GTK_MENU_ITEM(attention), NULL); |
3411 gtk_menu_item_set_submenu(GTK_MENU_ITEM(attention), NULL); |
| 3410 |
3412 |
| 3411 pc = purple_conversation_get_connection(conv); |
3413 pc = purple_conversation_get_connection(conv); |
| 3412 if (pc != NULL) |
3414 if (pc != NULL) |
| 3413 prpl = purple_connection_get_protocol_info(pc); |
3415 prpl_info = purple_connection_get_protocol_info(pc); |
| 3414 if (prpl != NULL) |
|
| 3415 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
| 3416 |
3416 |
| 3417 if (prpl_info && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_attention_types)) { |
3417 if (prpl_info && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_attention_types)) { |
| 3418 list = prpl_info->get_attention_types(purple_connection_get_account(pc)); |
3418 list = prpl_info->get_attention_types(purple_connection_get_account(pc)); |
| 3419 |
3419 |
| 3420 /* Multiple attention types */ |
3420 /* Multiple attention types */ |
| 4152 conv = PURPLE_CONVERSATION(chat); |
4152 conv = PURPLE_CONVERSATION(chat); |
| 4153 gtkconv = PIDGIN_CONVERSATION(conv); |
4153 gtkconv = PIDGIN_CONVERSATION(conv); |
| 4154 gtkchat = gtkconv->u.chat; |
4154 gtkchat = gtkconv->u.chat; |
| 4155 gc = purple_conversation_get_connection(conv); |
4155 gc = purple_conversation_get_connection(conv); |
| 4156 |
4156 |
| 4157 if (!gc || !(prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_protocol_info(gc)))) |
4157 if (!gc || !(prpl_info = purple_connection_get_protocol_info(gc))) |
| 4158 return; |
4158 return; |
| 4159 |
4159 |
| 4160 tm = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list)); |
4160 tm = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list)); |
| 4161 ls = GTK_LIST_STORE(tm); |
4161 ls = GTK_LIST_STORE(tm); |
| 4162 |
4162 |
| 4610 g_return_if_fail(conv != NULL); |
4610 g_return_if_fail(conv != NULL); |
| 4611 |
4611 |
| 4612 gc = purple_conversation_get_connection(conv); |
4612 gc = purple_conversation_get_connection(conv); |
| 4613 g_return_if_fail(gc != NULL); |
4613 g_return_if_fail(gc != NULL); |
| 4614 g_return_if_fail(purple_connection_get_protocol_info(gc) != NULL); |
4614 g_return_if_fail(purple_connection_get_protocol_info(gc) != NULL); |
| 4615 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_protocol_info(gc)); |
4615 prpl_info = purple_connection_get_protocol_info(gc); |
| 4616 |
4616 |
| 4617 if (prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME) |
4617 if (prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME) |
| 4618 return; |
4618 return; |
| 4619 |
4619 |
| 4620 if (PURPLE_IS_CONTACT(node)) |
4620 if (PURPLE_IS_CONTACT(node)) |
| 4834 static void |
4834 static void |
| 4835 setup_chat_topic(PidginConversation *gtkconv, GtkWidget *vbox) |
4835 setup_chat_topic(PidginConversation *gtkconv, GtkWidget *vbox) |
| 4836 { |
4836 { |
| 4837 PurpleConversation *conv = gtkconv->active_conv; |
4837 PurpleConversation *conv = gtkconv->active_conv; |
| 4838 PurpleConnection *gc = purple_conversation_get_connection(conv); |
4838 PurpleConnection *gc = purple_conversation_get_connection(conv); |
| 4839 PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_protocol_info(gc)); |
4839 PurplePluginProtocolInfo *prpl_info = purple_connection_get_protocol_info(gc); |
| 4840 if (prpl_info->options & OPT_PROTO_CHAT_TOPIC) |
4840 if (prpl_info->options & OPT_PROTO_CHAT_TOPIC) |
| 4841 { |
4841 { |
| 4842 GtkWidget *hbox, *label; |
4842 GtkWidget *hbox, *label; |
| 4843 PidginChatPane *gtkchat = gtkconv->u.chat; |
4843 PidginChatPane *gtkchat = gtkconv->u.chat; |
| 4844 |
4844 |
| 4883 if (!gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path)) |
4883 if (!gtk_tree_model_get_iter(GTK_TREE_MODEL(model), &iter, path)) |
| 4884 return FALSE; |
4884 return FALSE; |
| 4885 |
4885 |
| 4886 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &who, -1); |
4886 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, CHAT_USERS_NAME_COLUMN, &who, -1); |
| 4887 |
4887 |
| 4888 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_protocol_info(purple_account_get_connection(account))); |
4888 prpl_info = purple_connection_get_protocol_info(purple_account_get_connection(account)); |
| 4889 node = (PurpleBlistNode*)(purple_blist_find_buddy(purple_conversation_get_account(conv), who)); |
4889 node = (PurpleBlistNode*)(purple_blist_find_buddy(purple_conversation_get_account(conv), who)); |
| 4890 if (node && prpl_info && (prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) |
4890 if (node && prpl_info && (prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) |
| 4891 pidgin_blist_draw_tooltip(node, gtkconv->infopane); |
4891 pidgin_blist_draw_tooltip(node, gtkconv->infopane); |
| 4892 |
4892 |
| 4893 g_free(who); |
4893 g_free(who); |
| 5515 PurpleConversation *conv = gtkconv->active_conv; |
5515 PurpleConversation *conv = gtkconv->active_conv; |
| 5516 PidginWindow *win = gtkconv->win; |
5516 PidginWindow *win = gtkconv->win; |
| 5517 PurpleIMConversation *im; |
5517 PurpleIMConversation *im; |
| 5518 PurpleAccount *convaccount = purple_conversation_get_account(conv); |
5518 PurpleAccount *convaccount = purple_conversation_get_account(conv); |
| 5519 PurpleConnection *gc = purple_account_get_connection(convaccount); |
5519 PurpleConnection *gc = purple_account_get_connection(convaccount); |
| 5520 PurplePluginProtocolInfo *prpl_info = gc ? PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_protocol_info(gc)) : NULL; |
5520 PurplePluginProtocolInfo *prpl_info = gc ? purple_connection_get_protocol_info(gc) : NULL; |
| 5521 const guchar *data = gtk_selection_data_get_data(sd); |
5521 const guchar *data = gtk_selection_data_get_data(sd); |
| 5522 |
5522 |
| 5523 if (info == PIDGIN_DRAG_BLIST_NODE) |
5523 if (info == PIDGIN_DRAG_BLIST_NODE) |
| 5524 { |
5524 { |
| 5525 PurpleBlistNode *n = NULL; |
5525 PurpleBlistNode *n = NULL; |
| 6529 if ((flags & PURPLE_MESSAGE_RECV) && |
6529 if ((flags & PURPLE_MESSAGE_RECV) && |
| 6530 !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting")) |
6530 !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_incoming_formatting")) |
| 6531 gtk_font_options |= GTK_IMHTML_NO_COLOURS | GTK_IMHTML_NO_FONTS | GTK_IMHTML_NO_SIZES | GTK_IMHTML_NO_FORMATTING; |
6531 gtk_font_options |= GTK_IMHTML_NO_COLOURS | GTK_IMHTML_NO_FONTS | GTK_IMHTML_NO_SIZES | GTK_IMHTML_NO_FORMATTING; |
| 6532 |
6532 |
| 6533 /* this is gonna crash one day, I can feel it. */ |
6533 /* this is gonna crash one day, I can feel it. */ |
| 6534 if (PURPLE_PLUGIN_PROTOCOL_INFO(purple_find_protocol_info(purple_account_get_protocol_id(purple_conversation_get_account(conv))))->options & |
6534 if (purple_find_protocol_info(purple_account_get_protocol_id(purple_conversation_get_account(conv)))->options & |
| 6535 OPT_PROTO_USE_POINTSIZE) { |
6535 OPT_PROTO_USE_POINTSIZE) { |
| 6536 gtk_font_options |= GTK_IMHTML_USE_POINTSIZE; |
6536 gtk_font_options |= GTK_IMHTML_USE_POINTSIZE; |
| 6537 } |
6537 } |
| 6538 |
6538 |
| 6539 if (!(flags & PURPLE_MESSAGE_RECV) && (purple_conversation_get_features(conv) & PURPLE_CONNECTION_FLAG_ALLOW_CUSTOM_SMILEY)) |
6539 if (!(flags & PURPLE_MESSAGE_RECV) && (purple_conversation_get_features(conv) & PURPLE_CONNECTION_FLAG_ALLOW_CUSTOM_SMILEY)) |
| 7139 win = pidgin_conv_get_window(gtkconv); |
7139 win = pidgin_conv_get_window(gtkconv); |
| 7140 gc = purple_conversation_get_connection(conv); |
7140 gc = purple_conversation_get_connection(conv); |
| 7141 account = purple_conversation_get_account(conv); |
7141 account = purple_conversation_get_account(conv); |
| 7142 |
7142 |
| 7143 if (gc != NULL) |
7143 if (gc != NULL) |
| 7144 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_protocol_info(gc)); |
7144 prpl_info = purple_connection_get_protocol_info(gc); |
| 7145 |
7145 |
| 7146 if (win->menu.send_to != NULL) |
7146 if (win->menu.send_to != NULL) |
| 7147 update_send_to_selection(win); |
7147 update_send_to_selection(win); |
| 7148 |
7148 |
| 7149 /* |
7149 /* |
| 8188 purple_conversation_get_account(conv) == purple_connection_get_account(gc) && |
8188 purple_conversation_get_account(conv) == purple_connection_get_account(gc) && |
| 8189 g_object_get_data(G_OBJECT(conv), "want-to-rejoin")) { |
8189 g_object_get_data(G_OBJECT(conv), "want-to-rejoin")) { |
| 8190 GHashTable *comps = NULL; |
8190 GHashTable *comps = NULL; |
| 8191 PurpleChat *chat = purple_blist_find_chat(purple_conversation_get_account(conv), purple_conversation_get_name(conv)); |
8191 PurpleChat *chat = purple_blist_find_chat(purple_conversation_get_account(conv), purple_conversation_get_name(conv)); |
| 8192 if (chat == NULL) { |
8192 if (chat == NULL) { |
| 8193 PurplePluginProtocolInfo *prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_protocol_info(gc)); |
8193 PurplePluginProtocolInfo *prpl_info = purple_connection_get_protocol_info(gc); |
| 8194 |
8194 |
| 8195 if (prpl_info->chat_info_defaults != NULL) |
8195 if (prpl_info->chat_info_defaults != NULL) |
| 8196 comps = prpl_info->chat_info_defaults(gc, purple_conversation_get_name(conv)); |
8196 comps = prpl_info->chat_info_defaults(gc, purple_conversation_get_name(conv)); |
| 8197 } else { |
8197 } else { |
| 8198 comps = purple_chat_get_components(chat); |
8198 comps = purple_chat_get_components(chat); |
| 9746 PurpleConnection *gc; |
9746 PurpleConnection *gc; |
| 9747 PurplePluginProtocolInfo *prpl_info = NULL; |
9747 PurplePluginProtocolInfo *prpl_info = NULL; |
| 9748 |
9748 |
| 9749 gc = purple_conversation_get_connection(conv); |
9749 gc = purple_conversation_get_connection(conv); |
| 9750 if (gc != NULL) |
9750 if (gc != NULL) |
| 9751 prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_protocol_info(gc)); |
9751 prpl_info = purple_connection_get_protocol_info(gc); |
| 9752 if (prpl_info && prpl_info->set_chat_topic == NULL) |
9752 if (prpl_info && prpl_info->set_chat_topic == NULL) |
| 9753 /* This protocol doesn't support setting the chat room topic */ |
9753 /* This protocol doesn't support setting the chat room topic */ |
| 9754 return FALSE; |
9754 return FALSE; |
| 9755 |
9755 |
| 9756 text = purple_chat_conversation_get_topic(PURPLE_CHAT_CONVERSATION(conv)); |
9756 text = purple_chat_conversation_get_topic(PURPLE_CHAT_CONVERSATION(conv)); |
| 9876 away_list = make_status_icon_list(PIDGIN_STOCK_STATUS_AWAY, w); |
9876 away_list = make_status_icon_list(PIDGIN_STOCK_STATUS_AWAY, w); |
| 9877 prpl_lists = g_hash_table_new(g_str_hash, g_str_equal); |
9877 prpl_lists = g_hash_table_new(g_str_hash, g_str_equal); |
| 9878 } |
9878 } |
| 9879 |
9879 |
| 9880 static void |
9880 static void |
| 9881 plugin_changed_cb(PurplePlugin *p, gpointer data) |
9881 plugin_changed_cb(GPluginPlugin *p, gpointer data) |
| 9882 { |
9882 { |
| 9883 regenerate_plugins_items(data); |
9883 regenerate_plugins_items(data); |
| 9884 } |
9884 } |
| 9885 |
9885 |
| 9886 static gboolean gtk_conv_configure_cb(GtkWidget *w, GdkEventConfigure *event, gpointer data) { |
9886 static gboolean gtk_conv_configure_cb(GtkWidget *w, GdkEventConfigure *event, gpointer data) { |