# HG changeset patch # User Mark Doliner # Date 1131338963 0 # Node ID 8bcccf2988fa20225f35b1bec410b442591a5a60 # Parent 77fc8a9f0668bf46d0004138048a54e388857191 [gaim-migrate @ 14294] How does this look? 1. If an IRC account sets itself to "away" but does not enter a message, then use a default away message of "Away" 2. Sign-on-as-away for IRC committer: Tailor Script diff -r 77fc8a9f0668 -r 8bcccf2988fa src/protocols/irc/irc.c --- a/src/protocols/irc/irc.c Mon Nov 07 03:44:30 2005 +0000 +++ b/src/protocols/irc/irc.c Mon Nov 07 04:49:23 2005 +0000 @@ -450,6 +450,8 @@ if (!strcmp(status_id, "away")) { args[0] = gaim_status_get_attr_string(status, "message"); + if ((args[0] == NULL) || (*args[0] == '\0')) + args[0] = _("Away"); irc_cmd_away(irc, "away", NULL, args); } } diff -r 77fc8a9f0668 -r 8bcccf2988fa src/protocols/irc/msgs.c --- a/src/protocols/irc/msgs.c Mon Nov 07 03:44:30 2005 +0000 +++ b/src/protocols/irc/msgs.c Mon Nov 07 04:49:23 2005 +0000 @@ -437,6 +437,7 @@ void irc_msg_endmotd(struct irc_conn *irc, const char *name, const char *from, char **args) { GaimConnection *gc; + GaimStatus *status; GaimBlistNode *gnode, *cnode, *bnode; gc = gaim_account_get_connection(irc->account); @@ -445,6 +446,14 @@ gaim_connection_set_state(gc, GAIM_CONNECTED); + /* If we're away then set our away message */ + status = gaim_account_get_active_status(irc->account); + if (!gaim_status_get_type(status) != GAIM_STATUS_AVAILABLE) + { + GaimPluginProtocolInfo *prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); + prpl_info->set_status(irc->account, status); + } + /* this used to be in the core, but it's not now */ for (gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { if(!GAIM_BLIST_NODE_IS_GROUP(gnode))