pidgin/purple-plugin-pack

merge of '203e67013f357c671e83349ce137bb8ee3cbb69a'
org.guifications.plugins
2007-10-20, grim
663108442de4
merge of '203e67013f357c671e83349ce137bb8ee3cbb69a'
and '689a784bd9925664c7d76684a5e67b4e3749fd7d'
--- a/ChangeLog Sat Oct 20 16:03:41 2007 -0400
+++ b/ChangeLog Sat Oct 20 16:03:50 2007 -0400
@@ -8,7 +8,7 @@
* Listhandler now supports restoring a buddy list from a backed-up
blist.xml file created by backing up ~/.purple.
* Slashexec's '/exec command' and '!command' are now optional (QuLogic)
- * Added support for initial user modes to irc-more
+ * Added support for initial setting/unsetting of user modes to irc-more
* Added the abusive findip plugin
* Added infopane plugin
* Fixed autoreply so it doesn't reply with an empty message (rageboy04)
@@ -23,7 +23,7 @@
built against.
* Fixed building with ancient glib. (Bodo Bellut)
* Removed the .build file from hideconv to remove it from default
- builds. Pidgin 2.2.1 will have persistent conversations.
+ builds. Pidgin will have persistent conversations soon.
Version 2.1.1: 8/19/07
* Fixed lack of .build, .pidgin-plugin, and Makefile.mingw for convbadger
--- a/irc-more/irc-more.c Sat Oct 20 16:03:41 2007 -0400
+++ b/irc-more/irc-more.c Sat Oct 20 16:03:50 2007 -0400
@@ -32,7 +32,8 @@
#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 SET_UMODES purple_account_get_string(account, "umodes", "i")
+#define UNSET_UMODES purple_account_get_string(account, "umodes", NULL)
#define PLUGIN_ID "core-plugin_pack-irc-more"
@@ -95,8 +96,8 @@
{
/* should this be done on a timeout? */
PurpleAccount *account = NULL;
- const gchar *nick = NULL, *modes = NULL;
- gchar *msg = NULL;
+ const gchar *nick = NULL, *setmodes = NULL, *unsetmodes = NULL;
+ gchar *msg = NULL, *msg2 = NULL;
account = purple_connection_get_account(gc);
@@ -105,12 +106,18 @@
return;
nick = purple_connection_get_display_name(gc);
- modes = UMODES;
- msg = g_strdup_printf("MODE %s +%s\r\n", nick, modes);
+ setmodes = SET_UMODES;
+ unsetmodes = UNSET_UMODES;
+ msg = g_strdup_printf("MODE %s +%s\r\n", nick, setmodes);
irc_info->send_raw(gc, msg, strlen(msg));
+ g_free(msg);
- g_free(msg);
+ if(unsetmodes && *unsetmodes) {
+ msg2 = g_strdup_printf("MODE %s -%s\r\n", nick, unsetmodes);
+ irc_info->send_raw(gc, msg2, strlen(msg2));
+ g_free(msg2);
+ }
return;
}
@@ -238,9 +245,11 @@
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(_("User Modes On Connect"), "umodes", "i");
+ option = purple_account_option_string_new(_("Set User Modes On Connect"), "setumodes", "i");
irc_info->protocol_options = g_list_append(irc_info->protocol_options, option);
+ option = purple_account_option_string_new(_("Unset User Modes On Connect"), "unsetumodes", "");
+ irc_info->protocol_options = g_list_append(irc_info->protocol_options, option);
return TRUE;
}