comparison src/protocols/oscar/oscar.c @ 9244:e67b8cd33c6c

[gaim-migrate @ 10043] A patch from Tom Samstag to show "Info for somebody" in the buddy info results for AIM and ICQ. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 09 Jun 2004 03:40:33 +0000
parents cefe59828f90
children 7a8aa87164ae
comparison
equal deleted inserted replaced
9243:a9151be6fe1a 9244:e67b8cd33c6c
3790 static int gaim_parse_clientauto_ch4(aim_session_t *sess, char *who, fu16_t reason, fu32_t state, char *msg) { 3790 static int gaim_parse_clientauto_ch4(aim_session_t *sess, char *who, fu16_t reason, fu32_t state, char *msg) {
3791 GaimConnection *gc = sess->aux_data; 3791 GaimConnection *gc = sess->aux_data;
3792 3792
3793 switch(reason) { 3793 switch(reason) {
3794 case 0x0003: { /* Reply from an ICQ status message request */ 3794 case 0x0003: { /* Reply from an ICQ status message request */
3795 char *status_msg = oscar_icqstatus(state); 3795 char *title, *statusmsg, **splitmsg, *dialogmsg;
3796 char *dialog_msg, **splitmsg; 3796
3797 title = g_strdup_printf(_("Info for %s"), who);
3797 3798
3798 /* Split at (carriage return/newline)'s, then rejoin later with BRs between. */ 3799 /* Split at (carriage return/newline)'s, then rejoin later with BRs between. */
3800 statusmsg = oscar_icqstatus(state);
3799 splitmsg = g_strsplit(msg, "\r\n", 0); 3801 splitmsg = g_strsplit(msg, "\r\n", 0);
3800 3802 dialogmsg = g_strdup_printf(_("<B>UIN:</B> %s<BR><B>Status:</B> %s<HR>%s"), who, statusmsg, g_strjoinv("<BR>", splitmsg));
3801 dialog_msg = g_strdup_printf(_("<B>UIN:</B> %s<BR><B>Status:</B> %s<HR>%s"), who, status_msg, g_strjoinv("<BR>", splitmsg)); 3803 g_free(statusmsg);
3802 gaim_notify_formatted(gc, NULL, _("Buddy Information"), NULL, dialog_msg, NULL, NULL);
3803
3804 g_free(status_msg);
3805 g_free(dialog_msg);
3806 g_strfreev(splitmsg); 3804 g_strfreev(splitmsg);
3805
3806 gaim_notify_formatted(gc, title, _("Buddy Information"), NULL, dialogmsg, NULL, NULL);
3807
3808 g_free(title);
3809 g_free(dialogmsg);
3807 } break; 3810 } break;
3808 3811
3809 default: { 3812 default: {
3810 gaim_debug_warning("oscar", 3813 gaim_debug_warning("oscar",
3811 "Received an unknown client auto-response from %s. " 3814 "Received an unknown client auto-response from %s. "
3963 3966
3964 static int gaim_parse_userinfo(aim_session_t *sess, aim_frame_t *fr, ...) { 3967 static int gaim_parse_userinfo(aim_session_t *sess, aim_frame_t *fr, ...) {
3965 GaimConnection *gc = sess->aux_data; 3968 GaimConnection *gc = sess->aux_data;
3966 GaimAccount *account = gaim_connection_get_account(gc); 3969 GaimAccount *account = gaim_connection_get_account(gc);
3967 GString *str; 3970 GString *str;
3968 gchar *tmp = NULL, *info_utf8 = NULL, *away_utf8 = NULL; 3971 gchar *tmp = NULL, *info_utf8 = NULL, *away_utf8 = NULL, *title = NULL;
3969 va_list ap; 3972 va_list ap;
3970 aim_userinfo_t *userinfo; 3973 aim_userinfo_t *userinfo;
3971 3974
3972 va_start(ap, fr); 3975 va_start(ap, fr);
3973 userinfo = va_arg(ap, aim_userinfo_t *); 3976 userinfo = va_arg(ap, aim_userinfo_t *);
4013 } 4016 }
4014 } 4017 }
4015 4018
4016 tmp = gaim_str_sub_away_formatters(str->str, gaim_account_get_username(account)); 4019 tmp = gaim_str_sub_away_formatters(str->str, gaim_account_get_username(account));
4017 g_string_free(str, TRUE); 4020 g_string_free(str, TRUE);
4018 gaim_notify_formatted(gc, NULL, _("Buddy Information"), NULL, tmp, NULL, NULL); 4021 title = g_strdup_printf(_("Info for %s"), userinfo->sn);
4022 gaim_notify_formatted(gc, title, _("Buddy Information"), NULL, tmp, NULL, NULL);
4023 g_free(title);
4019 g_free(tmp); 4024 g_free(tmp);
4020 4025
4021 return 1; 4026 return 1;
4022 } 4027 }
4023 4028