pidgin/purple-plugin-pack

merge of '097e6c99a6344d10986b0ba95c262fc858426668'
org.guifications.plugins
2007-09-04, sadrul
9388973d2c42
merge of '097e6c99a6344d10986b0ba95c262fc858426668'
and '86f10baba795481da6d3ed46fa336568e1dba26a'
--- a/AUTHORS Tue Sep 04 20:57:32 2007 -0400
+++ b/AUTHORS Tue Sep 04 20:58:26 2007 -0400
@@ -44,6 +44,7 @@
Anthony Sofocleous
William Thompson
Chris Weyl
+qwert - realphabetize or replace with real name before release!
Special Thanks
==============
--- a/ChangeLog Tue Sep 04 20:57:32 2007 -0400
+++ b/ChangeLog Tue Sep 04 20:58:26 2007 -0400
@@ -2,6 +2,11 @@
* Merged autorejoin into irc-more. No prefs migration will take place.
You will need to reconfigure the delay yourself.
* Slashexec's '/exec command' and '!command' are now optional (QuLogic)
+ * Added support for initial user modes to irc-more
+ * Added the abusive findip plugin
+ * Fixed a crash in ignore where a nickname that is not all lowercase
+ causes unintended behavior resulting in a crash (rageboy04, qwert)
+ * Fixed a possible double-free crash in /notice support in irc-more.
* Fixed a crash in Slashexec that has only shown itself when using the
Offline Message Emulation plugin to emulate an offline message at the
same time as Slashexec is loaded.
--- a/ignore/ignore.c Tue Sep 04 20:57:32 2007 -0400
+++ b/ignore/ignore.c Tue Sep 04 20:58:26 2007 -0400
@@ -58,6 +58,7 @@
{
GString *string;
char *pref;
+ char *lower_case_username;
string = g_string_new(PREF_ROOT);
string = g_string_append_c(string, '/');
@@ -66,8 +67,10 @@
purple_prefs_add_none(string->str);
string = g_string_append_c(string, '/');
string = g_string_append(string, purple_account_get_username(account));
- if (!purple_prefs_exists(string->str))
- purple_prefs_add_none(string->str);
+ lower_case_username = g_ascii_strdown(string->str, string->len);
+ if (!purple_prefs_exists(lower_case_username))
+ purple_prefs_add_none(lower_case_username);
+ g_free(lower_case_username);
string = g_string_append_c(string, '/');
string = g_string_append(string, name);
pref = g_ascii_strdown(string->str, string->len);
--- a/irc-more/irc-more.c Tue Sep 04 20:57:32 2007 -0400
+++ b/irc-more/irc-more.c Tue Sep 04 20:58:26 2007 -0400
@@ -32,6 +32,7 @@
#define CTCP_REPLY purple_account_get_string(account, "ctcp-message", "Purple IRC")
#define PART_MESSAGE purple_account_get_string(account, "part-message", "Leaving.")
#define QUIT_MESSAGE purple_account_get_string(account, "quit-message", "Leaving.")
+#define UMODES purple_account_get_string(account, "umodes", "i")
#define PLUGIN_ID "core-plugin_pack-irc-more"
@@ -89,6 +90,25 @@
g_strfreev(splits);
}
+static void
+signed_on_cb(PurpleConnection *gc)
+{
+ /* should this be done on a timeout? */
+ PurpleAccount *account = NULL;
+ gchar *nick = NULL, *modes = NULL, *msg = NULL;
+
+ account = purple_connection_get_account(gc)
+ nick = purple_connection_get_display_name(gc);
+ modes = UMODES;
+ msg = g_strdup_printf("MODE %s +%s\r\n", nick, modes);
+
+ irc_info->send_raw(gc, msg, strlen(msg));
+
+ g_free(msg);
+
+ return;
+}
+
static PurpleCmdRet
notice_cmd_cb(PurpleConversation *conv, const gchar *cmd, gchar **args,
gchar **error, void *data)
@@ -130,8 +150,11 @@
irc_info->send_raw(gc, msg, len);
+ /* avoid a possible double-free crash */
+ if(msg != tmp);
+ g_free(tmp);
+
g_free(msg);
- g_free(tmp);
return PURPLE_CMD_RET_OK;
}
@@ -171,6 +194,7 @@
PurplePlugin *prpl = NULL;
PurpleAccountOption *option;
gchar *notice_help = NULL;
+ void *gc_handle = NULL;
prpl = purple_find_prpl("prpl-irc");
@@ -185,21 +209,31 @@
PURPLE_CMD_FLAG_IM | PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY,
"prpl-irc", notice_cmd_cb, notice_help, NULL);
+ /* we need this handle for the signed-on signal */
+ gc_handle = purple_connections_get_handle();
+
+ /* list signals in alphabetical order for consistency */
purple_signal_connect(prpl, "irc-sending-text", plugin,
G_CALLBACK(irc_sending_text), NULL);
purple_signal_connect(prpl, "irc-receiving-text", plugin,
G_CALLBACK(irc_receiving_text), NULL);
+ purple_signal_connect(gc_handle, "signed-on", plugin,
+ G_CALLBACK(signed_on_cb), NULL);
irc_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
+ /* Alphabetize the option label strings */
+ option = purple_account_option_string_new(_("CTCP Version reply"), "ctcp-message", "Purple IRC");
+ irc_info->protocol_options = g_list_append(irc_info->protocol_options, option);
+
option = purple_account_option_string_new(_("Default Quit Message"), "quit-message", "Leaving.");
irc_info->protocol_options = g_list_append(irc_info->protocol_options, option);
option = purple_account_option_string_new(_("Default Part Message"), "part-message", "Leaving.");
irc_info->protocol_options = g_list_append(irc_info->protocol_options, option);
- option = purple_account_option_string_new(_("CTCP Version reply"), "ctcp-message", "Purple IRC");
- irc_info->protocol_options = g_list_append(irc_info->protocol_options, option);
+ option = purple_account_option_string_new(_("User Modes On Connect"), "umodes", "i");
+ irc_info->protocol_options = g_list append(irc_info->protocol_options, option);
return TRUE;
}
--- a/listhandler/purple_blist_xml.c Tue Sep 04 20:57:32 2007 -0400
+++ b/listhandler/purple_blist_xml.c Tue Sep 04 20:58:26 2007 -0400
@@ -48,6 +48,11 @@
} LhPbxInfo;
+/*****************************************************************************
+ * Globals
+ ****************************************************************************/
+static GList *infolist = NULL;
+static GList *accountlist = NULL;
/*****************************************************************************
* "API"
@@ -79,20 +84,19 @@
}
/*****************************************************************************
- * Plugin Stuff
+ * Helpers
****************************************************************************/
static void
-lh_pbx_import_target_request(GList *l)
+lh_pbx_find_accounts(void)
{
return;
}
-static GList *
+static void
lh_pbx_import_file_parse(const char *file)
{
GError *error = NULL;
- GList *list = NULL;
LhPbxInfo tmpinfo = NULL;
gchar *contents = NULL;
gsize length = 0;
@@ -103,7 +107,7 @@
purple_debug_error("listhandler: import: blist.xml", "Error reading %s: %s\n",
file ? file : "(null)", error->message ? error->message : "(null)");
- return NULL;
+ return;
}
/* if we get here, we have the file's contents--parse into xmlnode tree */
@@ -157,12 +161,22 @@
}
}
- list = g_list_prepend(list, tmpinfo);
+ infolist = g_list_prepend(infolist, tmpinfo);
}
}
}
- return list;
+ return;
+}
+
+/*****************************************************************************
+ * Plugin Stuff
+ ****************************************************************************/
+
+static void
+lh_pbx_import_target_request(void)
+{
+ return;
}
static void
@@ -172,7 +186,10 @@
purple_debug_info("listhandler: import", "In request callback\n");
- lh_pbx_import_target_request(lh_pbx_file_parse(file));
+ lh_pbx_file_parse(file);
+ lh_pbx_find_accounts();
+
+ lh_pbx_import_target_request();
return;
}