pidgin.openq: 5e5c3cd7: Move function qq_filter_str in
ccpaging at pidgin.im
ccpaging at pidgin.im
Wed Dec 3 23:21:13 EST 2008
-----------------------------------------------------------------
Revision: 5e5c3cd7868eb9a61cc045abf11431ca47e65265
Ancestor: 9a8e022e77422973242600400154e639ff244df5
Author: ccpaging at pidgin.im
Date: 2008-11-11T07:24:48
Branch: im.pidgin.pidgin.openq
URL: http://d.pidgin.im/viewmtn/revision/info/5e5c3cd7868eb9a61cc045abf11431ca47e65265
Modified files:
libpurple/protocols/qq/utils.c
ChangeLog:
Move function qq_filter_str in
Change QQ number to unsigned long
-------------- next part --------------
============================================================
--- libpurple/protocols/qq/utils.c 699c6634e7564909e6bbc5720fa782d223e38c0c
+++ libpurple/protocols/qq/utils.c 57180e008eeeb3f82ea7ddd05f790eeaee694035
@@ -39,8 +39,6 @@
#include "util.h"
#include "utils.h"
-#define QQ_NAME_FORMAT "%d"
-
/* These functions are used only in development phase */
/*
static void _qq_show_socket(gchar *desc, gint fd) {
@@ -135,7 +133,7 @@ guint32 purple_name_to_uid(const gchar *
guint32 ret;
g_return_val_if_fail(name != NULL, 0);
- ret = strtol(name, NULL, 10);
+ ret = strtoul(name, NULL, 10);
if (errno == ERANGE)
return 0;
else
@@ -169,7 +167,7 @@ gchar *uid_to_purple_name(guint32 uid)
* the return needs to be freed */
gchar *uid_to_purple_name(guint32 uid)
{
- return g_strdup_printf(QQ_NAME_FORMAT, uid);
+ return g_strdup_printf("%u", uid);
}
/* try to dump the data as GBK */
@@ -339,3 +337,15 @@ void qq_show_packet(const gchar *desc, c
qq_hex_dump(PURPLE_DEBUG_WARNING, "QQ", buf, len, desc);
}
+void qq_filter_str(gchar *str) {
+ gchar *temp;
+ if (str == NULL) {
+ return;
+ }
+
+ for (temp = str; *temp != 0; temp++) {
+ /*if (*temp == '\r' || *temp == '\n') *temp = ' ';*/
+ if (*temp > 0 && *temp < 0x20) *temp = ' ';
+ }
+ g_strstrip(str);
+}
More information about the Commits
mailing list