Mercurial > pidgin.yaz
comparison src/gtkconv.c @ 4896:3c649fe22e2c
[gaim-migrate @ 5228]
this lets those silly MSN types put emoticons in their friendly names, and
have them show up in the convo window like they used to. they're weird like
that. ;-)
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Thu, 27 Mar 2003 17:07:21 +0000 |
parents | 9e50494f63a1 |
children | d80bc307e2c8 |
comparison
equal
deleted
inserted
replaced
4895:9e50494f63a1 | 4896:3c649fe22e2c |
---|---|
3869 char buf2[BUF_LONG]; | 3869 char buf2[BUF_LONG]; |
3870 char mdate[64]; | 3870 char mdate[64]; |
3871 char color[10]; | 3871 char color[10]; |
3872 char *str; | 3872 char *str; |
3873 char *with_font_tag; | 3873 char *with_font_tag; |
3874 | 3874 char *sml_attrib = NULL; |
3875 | 3875 |
3876 if(length == -1) | 3876 if(length == -1) |
3877 length = strlen(message) + 1; | 3877 length = strlen(message) + 1; |
3878 | 3878 |
3879 gtkconv = GAIM_GTK_CONVERSATION(conv); | 3879 gtkconv = GAIM_GTK_CONVERSATION(conv); |
3880 gc = gaim_conversation_get_gc(conv); | 3880 gc = gaim_conversation_get_gc(conv); |
3881 | 3881 |
3882 strftime(mdate, sizeof(mdate), "%H:%M:%S", localtime(&mtime)); | 3882 strftime(mdate, sizeof(mdate), "%H:%M:%S", localtime(&mtime)); |
3883 | |
3884 if(gc) | |
3885 sml_attrib = g_strdup_printf("sml=\"%s\"", gc->prpl->name); | |
3883 | 3886 |
3884 gtk_font_options ^= GTK_IMHTML_NO_COMMENTS; | 3887 gtk_font_options ^= GTK_IMHTML_NO_COMMENTS; |
3885 | 3888 |
3886 if (convo_options & OPT_CONVO_IGNORE_COLOUR) | 3889 if (convo_options & OPT_CONVO_IGNORE_COLOUR) |
3887 gtk_font_options ^= GTK_IMHTML_NO_COLOURS; | 3890 gtk_font_options ^= GTK_IMHTML_NO_COLOURS; |
4020 } | 4023 } |
4021 } | 4024 } |
4022 | 4025 |
4023 if (convo_options & OPT_CONVO_SHOW_TIME) | 4026 if (convo_options & OPT_CONVO_SHOW_TIME) |
4024 g_snprintf(buf, BUF_LONG, | 4027 g_snprintf(buf, BUF_LONG, |
4025 "<FONT COLOR=\"%s\"><FONT SIZE=\"2\">(%s) </FONT>" | 4028 "<FONT COLOR=\"%s\" %s><FONT SIZE=\"2\">(%s) </FONT>" |
4026 "<B>%s</B></FONT> ", color, mdate, str); | 4029 "<B>%s</B></FONT> ", color, |
4030 sml_attrib ? sml_attrib : "", mdate, str); | |
4027 else | 4031 else |
4028 g_snprintf(buf, BUF_LONG, | 4032 g_snprintf(buf, BUF_LONG, |
4029 "<FONT COLOR=\"%s\"><B>%s</B></FONT> ", color, str); | 4033 "<FONT COLOR=\"%s\" %s><B>%s</B></FONT> ", color, |
4034 sml_attrib ? sml_attrib : "", str); | |
4030 | 4035 |
4031 g_snprintf(buf2, BUF_LONG, | 4036 g_snprintf(buf2, BUF_LONG, |
4032 "<FONT COLOR=\"%s\"><FONT SIZE=\"2\"><!--(%s) --></FONT>" | 4037 "<FONT COLOR=\"%s\" %s><FONT SIZE=\"2\"><!--(%s) --></FONT>" |
4033 "<B>%s</B></FONT> ", | 4038 "<B>%s</B></FONT> ", |
4034 color, mdate, str); | 4039 color, sml_attrib ? sml_attrib : "", mdate, str); |
4035 | 4040 |
4036 g_free(str); | 4041 g_free(str); |
4037 | 4042 |
4038 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, -1, 0); | 4043 gtk_imhtml_append_text(GTK_IMHTML(gtkconv->imhtml), buf2, -1, 0); |
4039 | 4044 |
4040 if(gc){ | 4045 if(gc){ |
4041 char *pre = g_strdup_printf("<font sml=\"%s\">", gc->prpl->name); | 4046 char *pre = g_strdup_printf("<font %s>", sml_attrib ? sml_attrib : ""); |
4042 char *post = "</font>"; | 4047 char *post = "</font>"; |
4043 int pre_len = strlen(pre); | 4048 int pre_len = strlen(pre); |
4044 int post_len = strlen(post); | 4049 int post_len = strlen(post); |
4045 | 4050 |
4046 with_font_tag = g_malloc(length + pre_len + post_len + 1); | 4051 with_font_tag = g_malloc(length + pre_len + post_len + 1); |
4126 | 4131 |
4127 g_free(t1); | 4132 g_free(t1); |
4128 g_free(t2); | 4133 g_free(t2); |
4129 } | 4134 } |
4130 | 4135 |
4136 if(sml_attrib) | |
4137 g_free(sml_attrib); | |
4131 g_free(with_font_tag); | 4138 g_free(with_font_tag); |
4132 g_free(new_message); | 4139 g_free(new_message); |
4133 } | 4140 } |
4134 } | 4141 } |
4135 | 4142 |