org.guifications.plugins: 9d4684e5ce03d3cb57d49ec72554e52131ec4fc4
rekkanoryo at guifications.org
rekkanoryo at guifications.org
Sat Oct 20 01:45:06 CDT 2007
-----------------------------------------------------------------
Revision: 9d4684e5ce03d3cb57d49ec72554e52131ec4fc4
Ancestor: 2359fbb4fd608a470cbf2c1dd612870789e23846
Author: rekkanoryo at guifications.org
Date: 2007-10-20T06:41:44
Branch: org.guifications.plugins
Modified files:
irc-more/irc-more.c
ChangeLog:
Fix irc-more umode support by allowing the user to specify modes to unset
-----------------------------------------------------------------
This revision's diffstat output:
irc-more.c | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
-------------- next part --------------
============================================================
--- irc-more/irc-more.c f4f30922f759d9739e532ef65b93d98b8ebd5bf0
+++ irc-more/irc-more.c 505f934ba5e9960f1a62fda34d0d819a0d818efc
@@ -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 @@ signed_on_cb(PurpleConnection *gc)
{
/* 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 @@ signed_on_cb(PurpleConnection *gc)
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 @@ plugin_load(PurplePlugin *plugin)
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;
}
More information about the Plugins-commits
mailing list