# HG changeset patch # User Mark Doliner # Date 1120936793 0 # Node ID 634fec5ed0f2964e3ed2783ec45c4a2e1bc589ea # Parent fe1a1d73f42cb7651f07bd20d4ccf21e53baa619 [gaim-migrate @ 13082] sf patch #1235304, from Lalo Martins Allow for custom IRC quit messages. I hope Ethan doesn't kill me. Also, I couldn't get quit messages to work for me before OR after this patch. I tried using "/quit" and Buddies->Quit in the buddy list. What was I doing wrong? committer: Tailor Script diff -r fe1a1d73f42c -r 634fec5ed0f2 COPYRIGHT --- a/COPYRIGHT Sat Jul 09 18:54:43 2005 +0000 +++ b/COPYRIGHT Sat Jul 09 19:19:53 2005 +0000 @@ -126,6 +126,7 @@ Paolo Maggi Willian T. Mahan Fidel Martinez +Lalo Martins John Matthews Ryan McCabe Kurt McKee diff -r fe1a1d73f42c -r 634fec5ed0f2 src/gtkft.c --- a/src/gtkft.c Sat Jul 09 18:54:43 2005 +0000 +++ b/src/gtkft.c Sat Jul 09 19:19:53 2005 +0000 @@ -1142,7 +1142,8 @@ void gaim_gtk_xfers_uninit(void) { - gaim_gtkxfer_dialog_destroy(xfer_dialog); + if (xfer_dialog != NULL) + gaim_gtkxfer_dialog_destroy(xfer_dialog); } void diff -r fe1a1d73f42c -r 634fec5ed0f2 src/protocols/irc/cmds.c --- a/src/protocols/irc/cmds.c Sat Jul 09 18:54:43 2005 +0000 +++ b/src/protocols/irc/cmds.c Sat Jul 09 19:19:53 2005 +0000 @@ -365,7 +365,7 @@ char *buf; if (!irc->quitting) { - buf = irc_format(irc, "v:", "QUIT", (args && args[0]) ? args[0] : "Download Gaim: " GAIM_WEBSITE); + buf = irc_format(irc, "v:", "QUIT", (args && args[0]) ? args[0] : gaim_prefs_get_string("/plugins/prpl/irc/quitmsg")); irc_send(irc, buf); g_free(buf); diff -r fe1a1d73f42c -r 634fec5ed0f2 src/protocols/irc/irc.c --- a/src/protocols/irc/irc.c Sat Jul 09 18:54:43 2005 +0000 +++ b/src/protocols/irc/irc.c Sat Jul 09 19:19:53 2005 +0000 @@ -715,6 +715,27 @@ } } +static GaimPluginPrefFrame * +irc_pref_frame(GaimPlugin *plugin) { + GaimPluginPrefFrame *frame; + GaimPluginPref *ppref; + + frame = gaim_plugin_pref_frame_new(); + + ppref = gaim_plugin_pref_new_with_label(_("IRC")); + gaim_plugin_pref_frame_add(frame, ppref); + + ppref = gaim_plugin_pref_new_with_name_and_label("/plugins/prpl/irc/quitmsg", + _("Quit message")); + gaim_plugin_pref_frame_add(frame, ppref); + + return frame; +} + +static GaimPluginUiInfo prefs_info = { + irc_pref_frame +}; + static GaimPluginProtocolInfo prpl_info = { OPT_PROTO_CHAT_TOPIC | OPT_PROTO_PASSWORD_OPTIONAL, @@ -803,7 +824,7 @@ NULL, /**< ui_info */ &prpl_info, /**< extra_info */ - NULL, + &prefs_info, /**< prefs_info */ irc_actions }; @@ -834,6 +855,9 @@ _irc_plugin = plugin; + gaim_prefs_add_none("/plugins/prpl/irc"); + gaim_prefs_add_string("/plugins/prpl/irc/quitmsg", IRC_DEFAULT_QUIT); + irc_register_commands(); } diff -r fe1a1d73f42c -r 634fec5ed0f2 src/protocols/irc/irc.h --- a/src/protocols/irc/irc.h Sat Jul 09 18:54:43 2005 +0000 +++ b/src/protocols/irc/irc.h Sat Jul 09 19:19:53 2005 +0000 @@ -35,6 +35,8 @@ #define IRC_DEFAULT_CHARSET "UTF-8" #define IRC_DEFAULT_ALIAS "gaim" +#define IRC_DEFAULT_QUIT "Download Gaim: " GAIM_WEBSITE + #define IRC_INITIAL_BUFSIZE 1024