pidgin/purple-plugin-pack

Parents 48eac6f1a547
Children 18e221cca584
Re-add purple2 compatibility with #if PURPLE_VERSION_CHECK(3,0,0) blocks

Based on previous commits between 2.7.0 and now, this is sorta like reverting
those changes partially.
--- a/blistops/blistops.c Thu Apr 06 01:11:32 2017 -0300
+++ b/blistops/blistops.c Thu Apr 06 01:15:43 2017 -0300
@@ -175,7 +175,11 @@
PidginBuddyList *gtkblist = PIDGIN_BLIST(blist);
w_blist = gtkblist->window;
+#if PURPLE_VERSION_CHECK(3,0,0)
w_menubar = gtk_ui_manager_get_widget(gtkblist->ui, "/BList");
+#else
+ w_menubar = gtk_item_factory_get_widget(gtkblist->ift, "<PurpleMain>");
+#endif
g_signal_connect(gtkblist->treemodel, "row_changed", G_CALLBACK(row_changed_cb), gtkblist);
--- a/difftopic/difftopic.c Thu Apr 06 01:11:32 2017 -0300
+++ b/difftopic/difftopic.c Thu Apr 06 01:15:43 2017 -0300
@@ -151,19 +151,23 @@
topic_changed(PurpleConversation *conv, const char *who, const char *what)
{
PidginConversation *gtkconv;
+ GtkWidget *imhtml;
char *old;
#if PURPLE_VERSION_CHECK(3,0,0)
gtkconv = purple_conversation_get_ui_data(conv);
+ imhtml = gtkconv->webview;
#else
gtkconv = conv->ui_data;
+ imhtml = gtkconv->imhtml;
#endif
- old = g_object_get_data(G_OBJECT(gtkconv->webview), "difftopic");
+ old = g_object_get_data(G_OBJECT(imhtml), "difftopic");
if (old && what) {
- have_fun(GTK_IMHTML(gtkconv->webview), old, what);
+ /* TODO: GTK_IMHTML() cast gone from pidgin3 */
+ have_fun(GTK_IMHTML(imhtml), old, what);
}
- g_object_set_data_full(G_OBJECT(gtkconv->webview), "difftopic", g_strdup(what), (GDestroyNotify)g_free);
+ g_object_set_data_full(G_OBJECT(imhtml), "difftopic", g_strdup(what), (GDestroyNotify)g_free);
}
static gboolean
--- a/irc-more/irc-more.c Thu Apr 06 01:11:32 2017 -0300
+++ b/irc-more/irc-more.c Thu Apr 06 01:15:43 2017 -0300
@@ -113,11 +113,17 @@
*esc = g_markup_escape_text(cmd, -1);
int result = 0;
+#if !PURPLE_VERSION_CHECK(3,0,0)
/* this hack courtesy irchelper -- don't use purple_conversation_set_account
* because it will fire a signal that other plugins can use. Instead do
* this hack. This will break when struct hiding is complete and ABI breaks. */
+ PurpleConversation *conv = g_new0(PurpleConversation, 1);
+ conv->type = PURPLE_CONV_TYPE_IM;
+ conv->account = account;
+#else
PurpleConversation *conv = purple_conversation_new(PURPLE_CONV_TYPE_IM,
account, "None");
+#endif
purple_debug_info("irc-more", "Executng command: %s\n", cmd);
result = purple_cmd_do_command(conv, cmd, esc, &error);
--- a/irchelper/irchelper.c Thu Apr 06 01:11:32 2017 -0300
+++ b/irchelper/irchelper.c Thu Apr 06 01:15:43 2017 -0300
@@ -223,12 +223,18 @@
{
PurpleConversation *conv;
+#if PURPLE_VERSION_CHECK(3,0,0)
conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, "None");
+#else
+ conv = g_new0(PurpleConversation, 1);
+ conv->type = PURPLE_CONV_TYPE_IM;
/* If we use this then the conversation updated signal is fired and
* other plugins might start doing things to our conversation, such as
* setting data on it which we would then need to free etc. It's easier
* just to be more hacky by setting account directly. */
/* purple_conversation_set_account(conv, account); */
+ conv->account = account;
+#endif
return conv;
}
@@ -1312,7 +1318,11 @@
prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option);
option = purple_account_option_string_new(_("Nick password"), PLUGIN_ID "_nickpassword", "");
+#if PURPLE_VERSION_CHECK(3,0,0)
purple_account_option_string_set_masked(option, TRUE);
+#else
+ purple_account_option_set_masked(option, TRUE);
+#endif
prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option);
option = purple_account_option_bool_new(_("Disconnect ghosts (Duplicate nicknames)"),
@@ -1320,7 +1330,11 @@
prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option);
option = purple_account_option_string_new(_("Operator password"), PLUGIN_ID "_operpassword", "");
+#if PURPLE_VERSION_CHECK(3,0,0)
purple_account_option_string_set_masked(option, TRUE);
+#else
+ purple_account_option_set_masked(option, TRUE);
+#endif
prpl_info->protocol_options = g_list_append(prpl_info->protocol_options, option);
--- a/irssi/lastlog.c Thu Apr 06 01:11:32 2017 -0300
+++ b/irssi/lastlog.c Thu Apr 06 01:15:43 2017 -0300
@@ -58,9 +58,11 @@
/* let's avoid some warnings on anal C compilers like mipspro cc */
result = g_string_new(NULL);
- /*
+#if PURPLE_VERSION_CHECK(3,0,0)
+ /* TODO: not implemented */
+#else
lines = gtk_imhtml_get_markup_lines(GTK_IMHTML(gtkconv->imhtml));
- */
+#endif
/* XXX: This will include all messages, including the output of the
* history plugin, system messages, timestamps etc. This might be
--- a/schedule/pidgin-schedule.c Thu Apr 06 01:11:32 2017 -0300
+++ b/schedule/pidgin-schedule.c Thu Apr 06 01:15:43 2017 -0300
@@ -271,7 +271,14 @@
win->accounts = optmenu = pidgin_account_option_menu_new(NULL, TRUE, NULL, NULL, NULL);
win->buddy = entry = gtk_entry_new();
+#if PURPLE_VERSION_CHECK(3,0,0)
+ /* TODO: this doesn't seem to be equivalent to the purple2 version
+ * The last parameter, all=FALSE, means "Whether to include usernames
+ * from disconnected accounts". If it doesn't matter remove me. */
pidgin_setup_screenname_autocomplete(entry, optmenu, NULL, NULL);
+#else
+ pidgin_setup_screenname_autocomplete(entry, optmenu, FALSE);
+#endif
fr = pidgin_create_imhtml(TRUE, &imhtml, NULL, NULL);
win->imhtml = imhtml;
/* XXX: set the formatting to default send-message format */