diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2007-12-17 00:16:26 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2007-12-17 00:16:26 +0000 |
commit | f9aac3b100e24c293d99afb61a8d633a7f809a33 (patch) | |
tree | eb798dc26543125a7fa399618a21f2adff923b3d /src/im-channel-factory.c | |
parent | 1c191fde41e4be346dc17a8ad8594a5f181bc1d4 (diff) |
Fix turning incoming and outgoing linebreaks into spaces.
Diffstat (limited to 'src/im-channel-factory.c')
-rw-r--r-- | src/im-channel-factory.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/im-channel-factory.c b/src/im-channel-factory.c index b2906fe..1d9b207 100644 --- a/src/im-channel-factory.c +++ b/src/im-channel-factory.c @@ -419,11 +419,16 @@ haze_write_im (PurpleConversation *conv, ACCOUNT_GET_HAZE_CONNECTION (account)->im_factory; TpChannelTextMessageType type = TP_CHANNEL_TEXT_MESSAGE_TYPE_NORMAL; HazeIMChannel *chan = NULL; - char *message; + char *line_broken, *message; HazeConversationUiData *ui_data = PURPLE_CONV_GET_HAZE_UI_DATA (conv); - message = purple_markup_strip_html (xhtml_message); + /* Replaces newline characters with <br>, which then get turned back into + * newlines by purple_markup_strip_html (which replaces "\n" with " ")... + */ + line_broken = purple_strdup_withhtml (xhtml_message); + message = purple_markup_strip_html (line_broken); + g_free (line_broken); if (flags & PURPLE_MESSAGE_AUTO_RESP) type = TP_CHANNEL_TEXT_MESSAGE_TYPE_AUTO_REPLY; |