comparison libpurple/conversation.c @ 27862:382e7565e628

propagate from branch 'im.pidgin.pidgin' (head 3fc4df7332983d84a3632b6372c6f7c894b529a3) to branch 'im.pidgin.pidgin.yaz' (head a1fd4d210ffa81c75a163484d225652ae9727f93)
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Fri, 11 Jul 2008 18:29:35 +0000
parents 0b6475f97648 81ebe4fac9ce
children e4fa83bb82e0
comparison
equal deleted inserted replaced
23443:35673f4abf46 27862:382e7565e628
654 { 654 {
655 PurpleAccount *account; 655 PurpleAccount *account;
656 PurpleBuddy *b; 656 PurpleBuddy *b;
657 PurpleChat *chat; 657 PurpleChat *chat;
658 const char *text = NULL, *name; 658 const char *text = NULL, *name;
659 gchar *utf8;
660 gsize dummy;
659 661
660 g_return_if_fail(conv != NULL); 662 g_return_if_fail(conv != NULL);
661 663
662 account = purple_conversation_get_account(conv); 664 account = purple_conversation_get_account(conv);
663 name = purple_conversation_get_name(conv); 665 name = purple_conversation_get_name(conv);
672 674
673 675
674 if(text == NULL) 676 if(text == NULL)
675 text = name; 677 text = name;
676 678
677 purple_conversation_set_title(conv, text); 679 utf8 = sanitize_utf(text, strlen(text), &dummy);
680 purple_conversation_set_title(conv, utf8);
681 g_free(utf8);
678 } 682 }
679 683
680 void 684 void
681 purple_conversation_foreach(void (*func)(PurpleConversation *conv)) 685 purple_conversation_foreach(void (*func)(PurpleConversation *conv))
682 { 686 {
1160 void 1164 void
1161 purple_conv_im_write(PurpleConvIm *im, const char *who, const char *message, 1165 purple_conv_im_write(PurpleConvIm *im, const char *who, const char *message,
1162 PurpleMessageFlags flags, time_t mtime) 1166 PurpleMessageFlags flags, time_t mtime)
1163 { 1167 {
1164 PurpleConversation *c; 1168 PurpleConversation *c;
1169 char *tmpmessage = NULL;
1165 1170
1166 g_return_if_fail(im != NULL); 1171 g_return_if_fail(im != NULL);
1167 g_return_if_fail(message != NULL); 1172 g_return_if_fail(message != NULL);
1168 1173
1169 c = purple_conv_im_get_conversation(im); 1174 c = purple_conv_im_get_conversation(im);
1170 1175
1176 // yaz
1177 if (purple_prefs_get_bool("/purple/conversations/msnstyle")) {
1178 tmpmessage = g_strdup_printf("<br>%s", message);
1179 } else {
1180 tmpmessage = g_strdup_printf("%s", message);
1181 }
1182
1171 /* Pass this on to either the ops structure or the default write func. */ 1183 /* Pass this on to either the ops structure or the default write func. */
1172 if (c->ui_ops != NULL && c->ui_ops->write_im != NULL) 1184 if (c->ui_ops != NULL && c->ui_ops->write_im != NULL)
1173 c->ui_ops->write_im(c, who, message, flags, mtime); 1185 c->ui_ops->write_im(c, who, tmpmessage, flags, mtime);
1174 else 1186 else
1175 purple_conversation_write(c, who, message, flags, mtime); 1187 purple_conversation_write(c, who, tmpmessage, flags, mtime);
1188
1189 g_free(tmpmessage);
1176 } 1190 }
1177 1191
1178 gboolean purple_conv_present_error(const char *who, PurpleAccount *account, const char *what) 1192 gboolean purple_conv_present_error(const char *who, PurpleAccount *account, const char *what)
1179 { 1193 {
1180 PurpleConversation *conv; 1194 PurpleConversation *conv;