Mercurial > pidgin.yaz
comparison src/protocols/oscar/oscar.c @ 7108:6faeeecab0dc
[gaim-migrate @ 7673]
Put the rest of util.[ch] into namespaces and sectioned off the functions.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Wed, 01 Oct 2003 07:15:53 +0000 |
parents | 9220c7490cd1 |
children | b9664e6257b5 |
comparison
equal
deleted
inserted
replaced
7107:9220c7490cd1 | 7108:6faeeecab0dc |
---|---|
2257 tmp = strdup(_("(There was an error receiving this message)")); | 2257 tmp = strdup(_("(There was an error receiving this message)")); |
2258 g_error_free(err); | 2258 g_error_free(err); |
2259 } | 2259 } |
2260 } | 2260 } |
2261 | 2261 |
2262 /* strip_linefeed(tmp); */ | 2262 /* gaim_str_strip_linefeed(tmp); */ |
2263 serv_got_im(gc, userinfo->sn, tmp, flags, time(NULL)); | 2263 serv_got_im(gc, userinfo->sn, tmp, flags, time(NULL)); |
2264 g_free(tmp); | 2264 g_free(tmp); |
2265 | 2265 |
2266 return 1; | 2266 return 1; |
2267 } | 2267 } |
2557 /* Split up the message at the delimeter character, then convert each string to UTF-8 */ | 2557 /* Split up the message at the delimeter character, then convert each string to UTF-8 */ |
2558 msg1 = g_strsplit(args->msg, "\376", 0); | 2558 msg1 = g_strsplit(args->msg, "\376", 0); |
2559 for (numtoks=0; msg1[numtoks]; numtoks++); | 2559 for (numtoks=0; msg1[numtoks]; numtoks++); |
2560 msg2 = (gchar **)g_malloc((numtoks+1)*sizeof(gchar *)); | 2560 msg2 = (gchar **)g_malloc((numtoks+1)*sizeof(gchar *)); |
2561 for (i=0; msg1[i]; i++) { | 2561 for (i=0; msg1[i]; i++) { |
2562 strip_linefeed(msg1[i]); | 2562 gaim_str_strip_linefeed(msg1[i]); |
2563 msg2[i] = g_convert(msg1[i], strlen(msg1[i]), "UTF-8", "ISO-8859-1", NULL, NULL, &err); | 2563 msg2[i] = g_convert(msg1[i], strlen(msg1[i]), "UTF-8", "ISO-8859-1", NULL, NULL, &err); |
2564 if (err) { | 2564 if (err) { |
2565 gaim_debug(GAIM_DEBUG_ERROR, "oscar", | 2565 gaim_debug(GAIM_DEBUG_ERROR, "oscar", |
2566 "Error converting a string from ISO-8859-1 to " | 2566 "Error converting a string from ISO-8859-1 to " |
2567 "UTF-8 in oscar ICBM channel 4 parsing\n"); | 2567 "UTF-8 in oscar ICBM channel 4 parsing\n"); |
3151 if (userinfo->present & AIM_USERINFO_PRESENT_MEMBERSINCE) | 3151 if (userinfo->present & AIM_USERINFO_PRESENT_MEMBERSINCE) |
3152 g_string_append_printf(text, _("Member Since: <b>%s</b><br>\n"), | 3152 g_string_append_printf(text, _("Member Since: <b>%s</b><br>\n"), |
3153 asctime(localtime((time_t *)&userinfo->membersince))); | 3153 asctime(localtime((time_t *)&userinfo->membersince))); |
3154 | 3154 |
3155 if (userinfo->present & AIM_USERINFO_PRESENT_IDLE) { | 3155 if (userinfo->present & AIM_USERINFO_PRESENT_IDLE) { |
3156 gchar *itime = sec_to_text(userinfo->idletime*60); | 3156 gchar *itime = gaim_str_seconds_to_string(userinfo->idletime*60); |
3157 g_string_append_printf(text, _("Idle: <b>%s</b>"), itime); | 3157 g_string_append_printf(text, _("Idle: <b>%s</b>"), itime); |
3158 g_free(itime); | 3158 g_free(itime); |
3159 } else | 3159 } else |
3160 g_string_append_printf(text, _("Idle: <b>Active</b>")); | 3160 g_string_append_printf(text, _("Idle: <b>Active</b>")); |
3161 | 3161 |
3173 g_string_append_printf(text, _("<hr>%s"), info_utf8); | 3173 g_string_append_printf(text, _("<hr>%s"), info_utf8); |
3174 g_free(info_utf8); | 3174 g_free(info_utf8); |
3175 } | 3175 } |
3176 } | 3176 } |
3177 | 3177 |
3178 final = away_subs(text->str, gaim_connection_get_display_name(gc)); | 3178 final = gaim_str_sub_away_formatters(text->str, gaim_connection_get_display_name(gc)); |
3179 g_string_free(text, TRUE); | 3179 g_string_free(text, TRUE); |
3180 gaim_notify_formatted(gc, NULL, _("Buddy Information"), NULL, final, NULL, NULL); | 3180 gaim_notify_formatted(gc, NULL, _("Buddy Information"), NULL, final, NULL, NULL); |
3181 g_free(final); | 3181 g_free(final); |
3182 | 3182 |
3183 return 1; | 3183 return 1; |
3851 args.uin = msg->sender; | 3851 args.uin = msg->sender; |
3852 args.type = msg->type; | 3852 args.type = msg->type; |
3853 args.flags = msg->flags; | 3853 args.flags = msg->flags; |
3854 args.msglen = msg->msglen; | 3854 args.msglen = msg->msglen; |
3855 args.msg = msg->msg; | 3855 args.msg = msg->msg; |
3856 t = get_time(msg->year, msg->month, msg->day, msg->hour, msg->minute, 0); | 3856 t = gaim_time_build(msg->year, msg->month, msg->day, msg->hour, msg->minute, 0); |
3857 incomingim_chan4(sess, fr->conn, NULL, &args, t); | 3857 incomingim_chan4(sess, fr->conn, NULL, &args, t); |
3858 | 3858 |
3859 return 1; | 3859 return 1; |
3860 } | 3860 } |
3861 | 3861 |
3882 if (!info->uin) | 3882 if (!info->uin) |
3883 return 0; | 3883 return 0; |
3884 | 3884 |
3885 g_snprintf(who, sizeof(who), "%u", info->uin); | 3885 g_snprintf(who, sizeof(who), "%u", info->uin); |
3886 buf = g_strdup_printf("<b>%s:</b> %s", _("UIN"), who); | 3886 buf = g_strdup_printf("<b>%s:</b> %s", _("UIN"), who); |
3887 if (info->nick && info->nick[0] && (utf8 = gaim_try_conv_to_utf8(info->nick))) { | 3887 if (info->nick && info->nick[0] && (utf8 = gaim_utf8_try_convert(info->nick))) { |
3888 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Nick"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); | 3888 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Nick"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); |
3889 } | 3889 } |
3890 if (info->first && info->first[0] && (utf8 = gaim_try_conv_to_utf8(info->first))) { | 3890 if (info->first && info->first[0] && (utf8 = gaim_utf8_try_convert(info->first))) { |
3891 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("First Name"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); | 3891 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("First Name"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); |
3892 } | 3892 } |
3893 if (info->last && info->last[0] && (utf8 = gaim_try_conv_to_utf8(info->last))) { | 3893 if (info->last && info->last[0] && (utf8 = gaim_utf8_try_convert(info->last))) { |
3894 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Last Name"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); | 3894 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Last Name"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); |
3895 } | 3895 } |
3896 if (info->email && info->email[0] && (utf8 = gaim_try_conv_to_utf8(info->email))) { | 3896 if (info->email && info->email[0] && (utf8 = gaim_utf8_try_convert(info->email))) { |
3897 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Email Address"), ":</b> <a href=\"mailto:", utf8, "\">", utf8, "</a>", NULL); g_free(tmp); g_free(utf8); | 3897 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Email Address"), ":</b> <a href=\"mailto:", utf8, "\">", utf8, "</a>", NULL); g_free(tmp); g_free(utf8); |
3898 } | 3898 } |
3899 if (info->numaddresses && info->email2) { | 3899 if (info->numaddresses && info->email2) { |
3900 int i; | 3900 int i; |
3901 for (i = 0; i < info->numaddresses; i++) { | 3901 for (i = 0; i < info->numaddresses; i++) { |
3902 if (info->email2[i] && info->email2[i][0] && (utf8 = gaim_try_conv_to_utf8(info->email2[i]))) { | 3902 if (info->email2[i] && info->email2[i][0] && (utf8 = gaim_utf8_try_convert(info->email2[i]))) { |
3903 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Email Address"), ":</b> <a href=\"mailto:", utf8, "\">", utf8, "</a>", NULL); g_free(tmp); g_free(utf8); | 3903 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Email Address"), ":</b> <a href=\"mailto:", utf8, "\">", utf8, "</a>", NULL); g_free(tmp); g_free(utf8); |
3904 } | 3904 } |
3905 } | 3905 } |
3906 } | 3906 } |
3907 if (info->mobile && info->mobile[0] && (utf8 = gaim_try_conv_to_utf8(info->mobile))) { | 3907 if (info->mobile && info->mobile[0] && (utf8 = gaim_utf8_try_convert(info->mobile))) { |
3908 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Mobile Phone"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); | 3908 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Mobile Phone"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); |
3909 } | 3909 } |
3910 if (info->gender) { | 3910 if (info->gender) { |
3911 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Gender"), ":</b> ", info->gender==1 ? _("Female") : _("Male"), NULL); g_free(tmp); | 3911 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Gender"), ":</b> ", info->gender==1 ? _("Female") : _("Male"), NULL); g_free(tmp); |
3912 } | 3912 } |
3922 if (info->age) { | 3922 if (info->age) { |
3923 char age[5]; | 3923 char age[5]; |
3924 snprintf(age, sizeof(age), "%hhd", info->age); | 3924 snprintf(age, sizeof(age), "%hhd", info->age); |
3925 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Age"), ":</b> ", age, NULL); g_free(tmp); | 3925 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Age"), ":</b> ", age, NULL); g_free(tmp); |
3926 } | 3926 } |
3927 if (info->personalwebpage && info->personalwebpage[0] && (utf8 = gaim_try_conv_to_utf8(info->personalwebpage))) { | 3927 if (info->personalwebpage && info->personalwebpage[0] && (utf8 = gaim_utf8_try_convert(info->personalwebpage))) { |
3928 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Personal Web Page"), ":</b> <a href=\"", utf8, "\">", utf8, "</a>", NULL); g_free(tmp); g_free(utf8); | 3928 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Personal Web Page"), ":</b> <a href=\"", utf8, "\">", utf8, "</a>", NULL); g_free(tmp); g_free(utf8); |
3929 } | 3929 } |
3930 if (info->info && info->info[0] && (utf8 = gaim_try_conv_to_utf8(info->info))) { | 3930 if (info->info && info->info[0] && (utf8 = gaim_utf8_try_convert(info->info))) { |
3931 tmp = buf; buf = g_strconcat(tmp, "<hr><b>", _("Additional Information"), ":</b><br>", utf8, NULL); g_free(tmp); g_free(utf8); | 3931 tmp = buf; buf = g_strconcat(tmp, "<hr><b>", _("Additional Information"), ":</b><br>", utf8, NULL); g_free(tmp); g_free(utf8); |
3932 } | 3932 } |
3933 tmp = buf; buf = g_strconcat(tmp, "<hr>\n", NULL); g_free(tmp); | 3933 tmp = buf; buf = g_strconcat(tmp, "<hr>\n", NULL); g_free(tmp); |
3934 if ((info->homeaddr && (info->homeaddr[0])) || (info->homecity && info->homecity[0]) || (info->homestate && info->homestate[0]) || (info->homezip && info->homezip[0])) { | 3934 if ((info->homeaddr && (info->homeaddr[0])) || (info->homecity && info->homecity[0]) || (info->homestate && info->homestate[0]) || (info->homezip && info->homezip[0])) { |
3935 tmp = buf; buf = g_strconcat(tmp, "<b>", _("Home Address"), ":</b>", NULL); g_free(tmp); | 3935 tmp = buf; buf = g_strconcat(tmp, "<b>", _("Home Address"), ":</b>", NULL); g_free(tmp); |
3936 if (info->homeaddr && info->homeaddr[0] && (utf8 = gaim_try_conv_to_utf8(info->homeaddr))) { | 3936 if (info->homeaddr && info->homeaddr[0] && (utf8 = gaim_utf8_try_convert(info->homeaddr))) { |
3937 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Address"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); | 3937 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Address"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); |
3938 } | 3938 } |
3939 if (info->homecity && info->homecity[0] && (utf8 = gaim_try_conv_to_utf8(info->homecity))) { | 3939 if (info->homecity && info->homecity[0] && (utf8 = gaim_utf8_try_convert(info->homecity))) { |
3940 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("City"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); | 3940 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("City"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); |
3941 } | 3941 } |
3942 if (info->homestate && info->homestate[0] && (utf8 = gaim_try_conv_to_utf8(info->homestate))) { | 3942 if (info->homestate && info->homestate[0] && (utf8 = gaim_utf8_try_convert(info->homestate))) { |
3943 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("State"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); | 3943 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("State"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); |
3944 } | 3944 } |
3945 if (info->homezip && info->homezip[0] && (utf8 = gaim_try_conv_to_utf8(info->homezip))) { | 3945 if (info->homezip && info->homezip[0] && (utf8 = gaim_utf8_try_convert(info->homezip))) { |
3946 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Zip Code"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); | 3946 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Zip Code"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); |
3947 } | 3947 } |
3948 tmp = buf; buf = g_strconcat(tmp, "\n<hr>\n", NULL); g_free(tmp); | 3948 tmp = buf; buf = g_strconcat(tmp, "\n<hr>\n", NULL); g_free(tmp); |
3949 } | 3949 } |
3950 if ((info->workaddr && info->workaddr[0]) || (info->workcity && info->workcity[0]) || (info->workstate && info->workstate[0]) || (info->workzip && info->workzip[0])) { | 3950 if ((info->workaddr && info->workaddr[0]) || (info->workcity && info->workcity[0]) || (info->workstate && info->workstate[0]) || (info->workzip && info->workzip[0])) { |
3951 tmp = buf; buf = g_strconcat(tmp, "<b>", _("Work Address"), ":</b>", NULL); g_free(tmp); | 3951 tmp = buf; buf = g_strconcat(tmp, "<b>", _("Work Address"), ":</b>", NULL); g_free(tmp); |
3952 if (info->workaddr && info->workaddr[0] && (utf8 = gaim_try_conv_to_utf8(info->workaddr))) { | 3952 if (info->workaddr && info->workaddr[0] && (utf8 = gaim_utf8_try_convert(info->workaddr))) { |
3953 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Address"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); | 3953 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Address"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); |
3954 } | 3954 } |
3955 if (info->workcity && info->workcity[0] && (utf8 = gaim_try_conv_to_utf8(info->workcity))) { | 3955 if (info->workcity && info->workcity[0] && (utf8 = gaim_utf8_try_convert(info->workcity))) { |
3956 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("City"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); | 3956 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("City"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); |
3957 } | 3957 } |
3958 if (info->workstate && info->workstate[0] && (utf8 = gaim_try_conv_to_utf8(info->workstate))) { | 3958 if (info->workstate && info->workstate[0] && (utf8 = gaim_utf8_try_convert(info->workstate))) { |
3959 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("State"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); | 3959 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("State"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); |
3960 } | 3960 } |
3961 if (info->workzip && info->workzip[0] && (utf8 = gaim_try_conv_to_utf8(info->workzip))) { | 3961 if (info->workzip && info->workzip[0] && (utf8 = gaim_utf8_try_convert(info->workzip))) { |
3962 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Zip Code"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); | 3962 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Zip Code"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); |
3963 } | 3963 } |
3964 tmp = buf; buf = g_strconcat(tmp, "\n<hr>\n", NULL); g_free(tmp); | 3964 tmp = buf; buf = g_strconcat(tmp, "\n<hr>\n", NULL); g_free(tmp); |
3965 } | 3965 } |
3966 if ((info->workcompany && info->workcompany[0]) || (info->workdivision && info->workdivision[0]) || (info->workposition && info->workposition[0]) || (info->workwebpage && info->workwebpage[0])) { | 3966 if ((info->workcompany && info->workcompany[0]) || (info->workdivision && info->workdivision[0]) || (info->workposition && info->workposition[0]) || (info->workwebpage && info->workwebpage[0])) { |
3967 tmp = buf; buf = g_strconcat(tmp, "<b>", _("Work Information"), ":</b>", NULL); g_free(tmp); | 3967 tmp = buf; buf = g_strconcat(tmp, "<b>", _("Work Information"), ":</b>", NULL); g_free(tmp); |
3968 if (info->workcompany && info->workcompany[0] && (utf8 = gaim_try_conv_to_utf8(info->workcompany))) { | 3968 if (info->workcompany && info->workcompany[0] && (utf8 = gaim_utf8_try_convert(info->workcompany))) { |
3969 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Company"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); | 3969 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Company"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); |
3970 } | 3970 } |
3971 if (info->workdivision && info->workdivision[0] && (utf8 = gaim_try_conv_to_utf8(info->workdivision))) { | 3971 if (info->workdivision && info->workdivision[0] && (utf8 = gaim_utf8_try_convert(info->workdivision))) { |
3972 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Division"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); | 3972 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Division"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); |
3973 } | 3973 } |
3974 if (info->workposition && info->workposition[0] && (utf8 = gaim_try_conv_to_utf8(info->workposition))) { | 3974 if (info->workposition && info->workposition[0] && (utf8 = gaim_utf8_try_convert(info->workposition))) { |
3975 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Position"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); | 3975 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Position"), ":</b> ", utf8, NULL); g_free(tmp); g_free(utf8); |
3976 } | 3976 } |
3977 if (info->workwebpage && info->workwebpage[0] && (utf8 = gaim_try_conv_to_utf8(info->workwebpage))) { | 3977 if (info->workwebpage && info->workwebpage[0] && (utf8 = gaim_utf8_try_convert(info->workwebpage))) { |
3978 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Web Page"), ":</b> <a href=\"", utf8, "\">", utf8, "</a>", NULL); g_free(tmp); g_free(utf8); | 3978 tmp = buf; buf = g_strconcat(tmp, "\n<br><b>", _("Web Page"), ":</b> <a href=\"", utf8, "\">", utf8, "</a>", NULL); g_free(tmp); g_free(utf8); |
3979 } | 3979 } |
3980 tmp = buf; buf = g_strconcat(tmp, "\n<hr>\n", NULL); g_free(tmp); | 3980 tmp = buf; buf = g_strconcat(tmp, "\n<hr>\n", NULL); g_free(tmp); |
3981 } | 3981 } |
3982 | 3982 |
3999 | 3999 |
4000 va_start(ap, fr); | 4000 va_start(ap, fr); |
4001 info = va_arg(ap, struct aim_icq_info *); | 4001 info = va_arg(ap, struct aim_icq_info *); |
4002 va_end(ap); | 4002 va_end(ap); |
4003 | 4003 |
4004 if (info->uin && info->nick && info->nick[0] && (utf8 = gaim_try_conv_to_utf8(info->nick))) { | 4004 if (info->uin && info->nick && info->nick[0] && (utf8 = gaim_utf8_try_convert(info->nick))) { |
4005 g_snprintf(who, sizeof(who), "%u", info->uin); | 4005 g_snprintf(who, sizeof(who), "%u", info->uin); |
4006 serv_got_alias(gc, who, utf8); | 4006 serv_got_alias(gc, who, utf8); |
4007 if ((b = gaim_find_buddy(gc->account, who))) { | 4007 if ((b = gaim_find_buddy(gc->account, who))) { |
4008 gaim_buddy_set_setting(b, "servernick", utf8); | 4008 gaim_buddy_set_setting(b, "servernick", utf8); |
4009 gaim_blist_save(); | 4009 gaim_blist_save(); |
4283 | 4283 |
4284 args.destsn = name; | 4284 args.destsn = name; |
4285 | 4285 |
4286 /* For ICQ send newlines as CR/LF, for AIM send newlines as <BR> */ | 4286 /* For ICQ send newlines as CR/LF, for AIM send newlines as <BR> */ |
4287 if (isdigit(name[0])) | 4287 if (isdigit(name[0])) |
4288 tmpmsg = add_cr(message); | 4288 tmpmsg = gaim_str_add_cr(message); |
4289 else | 4289 else |
4290 tmpmsg = strdup_withhtml(message); | 4290 tmpmsg = gaim_strdup_withhtml(message); |
4291 len = strlen(tmpmsg); | 4291 len = strlen(tmpmsg); |
4292 | 4292 |
4293 args.flags |= oscar_encoding_check(tmpmsg); | 4293 args.flags |= oscar_encoding_check(tmpmsg); |
4294 if (args.flags & AIM_IMFLAGS_UNICODE) { | 4294 if (args.flags & AIM_IMFLAGS_UNICODE) { |
4295 gaim_debug(GAIM_DEBUG_INFO, "oscar", "Sending Unicode IM\n"); | 4295 gaim_debug(GAIM_DEBUG_INFO, "oscar", "Sending Unicode IM\n"); |
4403 if (!text) { | 4403 if (!text) { |
4404 aim_locate_setprofile(od->sess, NULL, NULL, 0, NULL, NULL, 0, caps_aim); | 4404 aim_locate_setprofile(od->sess, NULL, NULL, 0, NULL, NULL, 0, caps_aim); |
4405 return; | 4405 return; |
4406 } | 4406 } |
4407 | 4407 |
4408 text_html = strdup_withhtml(text); | 4408 text_html = gaim_strdup_withhtml(text); |
4409 flags = oscar_encoding_check(text_html); | 4409 flags = oscar_encoding_check(text_html); |
4410 if (flags & AIM_IMFLAGS_UNICODE) { | 4410 if (flags & AIM_IMFLAGS_UNICODE) { |
4411 msg = g_convert(text_html, strlen(text_html), "UCS-2BE", "UTF-8", NULL, &msglen, NULL); | 4411 msg = g_convert(text_html, strlen(text_html), "UCS-2BE", "UTF-8", NULL, &msglen, NULL); |
4412 aim_locate_setprofile(od->sess, "unicode-2-0", msg, (msglen > od->rights.maxsiglen ? od->rights.maxsiglen : msglen), NULL, NULL, 0, caps_aim); | 4412 aim_locate_setprofile(od->sess, "unicode-2-0", msg, (msglen > od->rights.maxsiglen ? od->rights.maxsiglen : msglen), NULL, NULL, 0, caps_aim); |
4413 g_free(msg); | 4413 g_free(msg); |
4461 if (!text) { | 4461 if (!text) { |
4462 aim_locate_setprofile(od->sess, NULL, NULL, 0, NULL, "", 0, caps_aim); | 4462 aim_locate_setprofile(od->sess, NULL, NULL, 0, NULL, "", 0, caps_aim); |
4463 return; | 4463 return; |
4464 } | 4464 } |
4465 | 4465 |
4466 text_html = strdup_withhtml(text); | 4466 text_html = gaim_strdup_withhtml(text); |
4467 flags = oscar_encoding_check(text_html); | 4467 flags = oscar_encoding_check(text_html); |
4468 if (flags & AIM_IMFLAGS_UNICODE) { | 4468 if (flags & AIM_IMFLAGS_UNICODE) { |
4469 msg = g_convert(text_html, strlen(text_html), "UCS-2BE", "UTF-8", NULL, &msglen, NULL); | 4469 msg = g_convert(text_html, strlen(text_html), "UCS-2BE", "UTF-8", NULL, &msglen, NULL); |
4470 aim_locate_setprofile(od->sess, NULL, NULL, 0, "unicode-2-0", msg, | 4470 aim_locate_setprofile(od->sess, NULL, NULL, 0, "unicode-2-0", msg, |
4471 (msglen > od->rights.maxawaymsglen ? od->rights.maxawaymsglen : msglen), caps_aim); | 4471 (msglen > od->rights.maxawaymsglen ? od->rights.maxawaymsglen : msglen), caps_aim); |
4785 for (curitem=sess->ssi.local; curitem; curitem=curitem->next) { | 4785 for (curitem=sess->ssi.local; curitem; curitem=curitem->next) { |
4786 switch (curitem->type) { | 4786 switch (curitem->type) { |
4787 case 0x0000: { /* Buddy */ | 4787 case 0x0000: { /* Buddy */ |
4788 if (curitem->name) { | 4788 if (curitem->name) { |
4789 char *gname = aim_ssi_itemlist_findparentname(sess->ssi.local, curitem->name); | 4789 char *gname = aim_ssi_itemlist_findparentname(sess->ssi.local, curitem->name); |
4790 char *gname_utf8 = gaim_try_conv_to_utf8(gname); | 4790 char *gname_utf8 = gaim_utf8_try_convert(gname); |
4791 char *alias = aim_ssi_getalias(sess->ssi.local, gname, curitem->name); | 4791 char *alias = aim_ssi_getalias(sess->ssi.local, gname, curitem->name); |
4792 char *alias_utf8 = gaim_try_conv_to_utf8(alias); | 4792 char *alias_utf8 = gaim_utf8_try_convert(alias); |
4793 GaimBuddy *buddy = gaim_find_buddy(gc->account, curitem->name); | 4793 GaimBuddy *buddy = gaim_find_buddy(gc->account, curitem->name); |
4794 /* Should gname be freed here? -- elb */ | 4794 /* Should gname be freed here? -- elb */ |
4795 /* Not with the current code, but that might be cleaner -- med */ | 4795 /* Not with the current code, but that might be cleaner -- med */ |
4796 free(alias); | 4796 free(alias); |
4797 if (buddy) { | 4797 if (buddy) { |
5375 g_free(tmp); | 5375 g_free(tmp); |
5376 g_free(status); | 5376 g_free(status); |
5377 } | 5377 } |
5378 | 5378 |
5379 if (userinfo != NULL) { | 5379 if (userinfo != NULL) { |
5380 char *tstr = sec_to_text(time(NULL) - userinfo->onlinesince + | 5380 char *tstr = gaim_str_seconds_to_string(time(NULL) - userinfo->onlinesince + |
5381 (gc->login_time_official ? gc->login_time_official - gc->login_time : 0)); | 5381 (gc->login_time_official ? gc->login_time_official - gc->login_time : 0)); |
5382 tmp = ret; | 5382 tmp = ret; |
5383 ret = g_strconcat(tmp, _("<b>Logged In:</b> "), tstr, "\n", NULL); | 5383 ret = g_strconcat(tmp, _("<b>Logged In:</b> "), tstr, "\n", NULL); |
5384 free(tmp); | 5384 free(tmp); |
5385 free(tstr); | 5385 free(tstr); |
5417 if (away_utf8 != NULL) { | 5417 if (away_utf8 != NULL) { |
5418 gchar *tmp1, *tmp2; | 5418 gchar *tmp1, *tmp2; |
5419 tmp1 = gaim_strreplace(away_utf8, "<BR>", "\n"); | 5419 tmp1 = gaim_strreplace(away_utf8, "<BR>", "\n"); |
5420 tmp2 = gaim_markup_strip_html(tmp1); | 5420 tmp2 = gaim_markup_strip_html(tmp1); |
5421 g_free(tmp1); | 5421 g_free(tmp1); |
5422 tmp1 = away_subs(tmp2, gaim_connection_get_display_name(gc)); | 5422 tmp1 = gaim_str_sub_away_formatters(tmp2, gaim_connection_get_display_name(gc)); |
5423 g_free(tmp2); | 5423 g_free(tmp2); |
5424 tmp = ret; | 5424 tmp = ret; |
5425 ret = g_strconcat(tmp, _("<b>Away Message:</b> "), tmp1, "\n", NULL); | 5425 ret = g_strconcat(tmp, _("<b>Away Message:</b> "), tmp1, "\n", NULL); |
5426 free(tmp); | 5426 free(tmp); |
5427 g_free(tmp1); | 5427 g_free(tmp1); |