changeset 14055:44e1bf83dadf

[gaim-migrate @ 16668] We have gaim_str_has_prefix() to use in place of g_str_has_prefix(). committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Tue, 08 Aug 2006 00:25:19 +0000
parents 51f71ad82141
children 25fd9539c9cf
files src/protocols/bonjour/jabber.c src/protocols/qq/group_find.c src/protocols/qq/utils.c
diffstat 3 files changed, 5 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/bonjour/jabber.c	Mon Aug 07 23:10:37 2006 +0000
+++ b/src/protocols/bonjour/jabber.c	Tue Aug 08 00:25:19 2006 +0000
@@ -359,7 +359,7 @@
 	 * using a magic string, but xmlnode won't play nice when just
 	 * parsing an end tag
 	 */
-	if (g_str_has_prefix(message, STREAM_END) || (closed_conversation == TRUE)) {
+	if (gaim_str_has_prefix(message, STREAM_END) || (closed_conversation == TRUE)) {
 		/* Close the socket, clear the watcher and free memory */
 		if (bb->conversation != NULL) {
 			close(bb->conversation->socket);
--- a/src/protocols/qq/group_find.c	Mon Aug 07 23:10:37 2006 +0000
+++ b/src/protocols/qq/group_find.c	Tue Aug 08 00:25:19 2006 +0000
@@ -22,6 +22,7 @@
 
 #include "conversation.h"
 #include "debug.h"
+#include "util.h"
 
 #include "group_find.h"
 #include "group_network.h"
@@ -39,7 +40,7 @@
 
 	/* if it starts with QQ_NAME_PREFIX, we think it is valid name already
 	 * otherwise we think it is nickname and try to find the matching gaim_name */
-	if (g_str_has_prefix(who, QQ_NAME_PREFIX) && gaim_name_to_uid(who) > 0)
+	if (gaim_str_has_prefix(who, QQ_NAME_PREFIX) && gaim_name_to_uid(who) > 0)
 		return (gchar *) who;
 
 	group = qq_group_find_by_channel(gc, channel);
--- a/src/protocols/qq/utils.c	Mon Aug 07 23:10:37 2006 +0000
+++ b/src/protocols/qq/utils.c	Tue Aug 08 00:25:19 2006 +0000
@@ -31,18 +31,11 @@
 #include "char_conv.h"
 #include "debug.h"
 #include "prefs.h"
+#include "util.h"
 #include "utils.h"
 
 #define QQ_NAME_FORMAT    "qq-%d"
 
-#if !GLIB_CHECK_VERSION(2, 1, 0)
-gint g_str_has_prefix(const gchar *str, const gchar *prefix)
-{
-	gint len = strlen(prefix);
-	return !strncmp(str, prefix, len);
-}
-#endif
-
 gchar *get_name_by_index_str(gchar **array, const gchar *index_str, gint amount)
 {
 	gint index;
@@ -160,7 +153,7 @@
 {
 	gchar *p;
 
-	g_return_val_if_fail(g_str_has_prefix(name, QQ_NAME_PREFIX), 0);
+	g_return_val_if_fail(gaim_str_has_prefix(name, QQ_NAME_PREFIX), 0);
 
 	p = g_strrstr(name, QQ_NAME_PREFIX);
 	return (p == NULL) ? 0 : strtol(p + strlen(QQ_NAME_PREFIX), NULL, 10);