# HG changeset patch # User Mark Doliner # Date 1135885019 0 # Node ID f5c72fd691ee4bad28140f01c04e9067d0dd9c4d # Parent 87e95b8ce60bff1cf45b8cdbb07179c92d7d361d [gaim-migrate @ 15020] Move the away %n %d %t substitution code out of server.c and into oscar.c committer: Tailor Script diff -r 87e95b8ce60b -r f5c72fd691ee src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Thu Dec 29 19:34:23 2005 +0000 +++ b/src/protocols/oscar/oscar.c Thu Dec 29 19:36:59 2005 +0000 @@ -6393,11 +6393,16 @@ struct oscar_direct_im *dim = oscar_direct_im_find(od, name); int ret = 0; char *iconfile = gaim_buddy_icons_get_full_path(gaim_account_get_buddy_icon(account)); - char *tmpmsg = NULL; + char *tmp1, *tmp2; + + if (imflags & GAIM_MESSAGE_AUTO_RESP) + tmp1 = gaim_str_sub_away_formatters(message, name); + else + tmp1 = g_strdup(message); if (dim && dim->connected) { /* If we're directly connected, send a direct IM */ - ret = gaim_odc_send_im(od->sess, dim->conn, message, imflags); + ret = gaim_odc_send_im(od->sess, dim->conn, tmp1, imflags); } else { struct buddyinfo *bi; struct aim_sendimext_args args; @@ -6407,7 +6412,7 @@ conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, name, account); - if (strstr(message, "sess, &args); g_free((char *)args.msg); } - g_free(tmpmsg); + g_free(tmp1); if (ret >= 0) return 1; diff -r 87e95b8ce60b -r f5c72fd691ee src/server.c --- a/src/server.c Thu Dec 29 19:34:23 2005 +0000 +++ b/src/server.c Thu Dec 29 19:36:59 2005 +0000 @@ -499,8 +499,6 @@ if (!gaim_presence_is_available(presence)) { time_t t = time(NULL); - GaimBuddy *b = gaim_find_buddy(gc->account, name); - const char *alias = b ? gaim_buddy_get_alias(b) : name; struct last_auto_response *lar; const gchar *auto_reply_pref; const char *away_msg; @@ -559,15 +557,11 @@ if ((away_msg == NULL) || (*away_msg == '\0')) return; - /* Move this to oscar.c! */ - buffy = gaim_str_sub_away_formatters(away_msg, alias); - serv_send_im(gc, name, buffy, GAIM_MESSAGE_AUTO_RESP); + serv_send_im(gc, name, away_msg, GAIM_MESSAGE_AUTO_RESP); - gaim_conv_im_write(GAIM_CONV_IM(cnv), NULL, buffy, + gaim_conv_im_write(GAIM_CONV_IM(cnv), NULL, away_msg, GAIM_MESSAGE_SEND | GAIM_MESSAGE_AUTO_RESP, mtime); - - g_free(buffy); } else {