Mercurial > pidgin
changeset 11073:634fec5ed0f2
[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 <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 09 Jul 2005 19:19:53 +0000 |
parents | fe1a1d73f42c |
children | ba630d7a7365 |
files | COPYRIGHT src/gtkft.c src/protocols/irc/cmds.c src/protocols/irc/irc.c src/protocols/irc/irc.h |
diffstat | 5 files changed, 31 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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
--- 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);
--- 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(); }
--- 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