Mercurial > pidgin
diff libpurple/protocols/qq/char_conv.c @ 23561:bdb38a8bf721
20080717-05-1-fix-keep-alive ccpaging <ecc_hy(at)hotmail.com>
* Fixed: Always lost connection. Now send keep alive packet in every 30 seconds
* Minor fix for debug information
* Filter \r\n and replace with SPCAE in group notive
* Fixed a memory leak
Tickets:
Fixes #4024.
author | SHiNE CsyFeK <csyfek@gmail.com> |
---|---|
date | Thu, 17 Jul 2008 15:12:42 +0000 |
parents | ebad75b719f5 |
children | 1c50f12b1c52 |
line wrap: on
line diff
--- a/libpurple/protocols/qq/char_conv.c Thu Jul 17 05:26:47 2008 +0000 +++ b/libpurple/protocols/qq/char_conv.c Thu Jul 17 15:12:42 2008 +0000 @@ -123,10 +123,7 @@ return g_strdup(QQ_NULL_MSG); } -/** - * @brief 把输入作为一个pascal字符串并返回一个用UFT-8转换的c-字符串.\n - * 返回已读入的字节数,或者当遇到错误时返回-1.该完成转换的UTF-8字符串被保存到ret中 - * +/* * take the input as a pascal string and return a converted c-string in UTF-8 * returns the number of bytes read, return -1 if fatal error * the converted UTF-8 will be saved in ret @@ -281,3 +278,17 @@ g_string_free(converted, FALSE); return ret; } + +void qq_filter_str(gchar *str) { + gchar *temp; + if (str == NULL) { + return; + } + + for (temp = str; *temp != 0; temp++) { + if (*temp == '\r' || *temp == '\n') *temp = 0x20; + } + g_strstrip(str); +} + +