changeset 28733:cfcf5076b73f

merge of '1cebb8e5585732c30dcfb31a6700dcb78ae47b44' and '9e66a21277bce5b8be225115269300903be335ea'
author Marcus Lundblad <ml@update.uu.se>
date Tue, 01 Dec 2009 21:36:55 +0000
parents 1bb466ce21b8 (diff) bc1eb4dacd00 (current diff)
children 6c5deb5d04bd
files ChangeLog libpurple/protocols/jabber/buddy.c
diffstat 6 files changed, 12 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/buddy.c	Tue Dec 01 21:26:58 2009 +0000
+++ b/libpurple/protocols/jabber/buddy.c	Tue Dec 01 21:36:55 2009 +0000
@@ -1870,8 +1870,10 @@
 	 * However, since the gateway might appear offline to us, we cannot get that information. Therefore, I just assume
 	 * that gateways on the roster can be identified by having no '@' in their jid. This is a faily safe assumption, since
 	 * people don't tend to have a server or other service there.
+	 *
+	 * TODO: Use disco#info...
 	 */
-	if (g_utf8_strchr(name, -1, '@') == NULL) {
+	if (strchr(name, '@') == NULL) {
 		act = purple_menu_action_new(_("Log In"),
 									 PURPLE_CALLBACK(jabber_buddy_login),
 									 NULL, NULL);
--- a/libpurple/protocols/jabber/chat.c	Tue Dec 01 21:26:58 2009 +0000
+++ b/libpurple/protocols/jabber/chat.c	Tue Dec 01 21:36:55 2009 +0000
@@ -927,7 +927,7 @@
 	jcm = g_hash_table_lookup(chat->members, who);
 	if (jcm && jcm->jid)
 		jid = jcm->jid;
-	else if (g_utf8_strchr(who, -1, '@') != NULL)
+	else if (strchr(who, '@') != NULL)
 		jid = who;
 	else
 		return FALSE;
@@ -964,7 +964,7 @@
 	jcm = g_hash_table_lookup(chat->members, who);
 	if (jcm && jcm->jid)
 		jid = jcm->jid;
-	else if (g_utf8_strchr(who, -1, '@') != NULL)
+	else if (strchr(who, '@') != NULL)
 		jid = who;
 	else
 		return FALSE;
--- a/libpurple/protocols/jabber/jabber.c	Tue Dec 01 21:26:58 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Tue Dec 01 21:36:55 2009 +0000
@@ -1116,7 +1116,8 @@
 
 	if(cbdata->js->registration) {
 		username = g_strdup_printf("%s@%s%s%s", cbdata->js->user->node, cbdata->js->user->domain,
-			cbdata->js->user->resource ? "/" : "", cbdata->js->user->resource);
+			cbdata->js->user->resource ? "/" : "",
+			cbdata->js->user->resource ? cbdata->js->user->resource : "");
 		purple_account_set_username(cbdata->js->gc->account, username);
 		g_free(username);
 	}
--- a/libpurple/protocols/jabber/jingle/session.c	Tue Dec 01 21:26:58 2009 +0000
+++ b/libpurple/protocols/jabber/jingle/session.c	Tue Dec 01 21:36:55 2009 +0000
@@ -377,7 +377,7 @@
 {
 	JingleSession *session = (JingleSession *)value;
 	const gchar *jid = user_data;
-	gboolean use_bare = g_utf8_strchr(jid, -1, '/') == NULL;
+	gboolean use_bare = strchr(jid, '/') == NULL;
 	gchar *remote_jid = jingle_session_get_remote_jid(session);
 	gchar *cmp_jid = use_bare ? jabber_get_bare_jid(remote_jid)
 				  : g_strdup(remote_jid);
@@ -438,7 +438,7 @@
 
 	data.jid = jid;
 	data.ret = NULL;
-	data.use_bare = g_utf8_strchr(jid, -1, '/') == NULL;
+	data.use_bare = strchr(jid, '/') == NULL;
 
 	g_hash_table_foreach(js->sessions, find_by_jid_ghr, &data);
 	return data.ret;
--- a/libpurple/protocols/jabber/presence.c	Tue Dec 01 21:26:58 2009 +0000
+++ b/libpurple/protocols/jabber/presence.c	Tue Dec 01 21:36:55 2009 +0000
@@ -433,7 +433,7 @@
                                  JabberPresenceCapabilities *userdata)
 {
 	JabberBuddyResource *jbr;
-	char *resource = g_utf8_strchr(userdata->from, -1, '/');
+	char *resource = strchr(userdata->from, '/');
 
 	if (resource)
 		resource += 1;
--- a/pidgin/plugins/disco/gtkdisco.c	Tue Dec 01 21:26:58 2009 +0000
+++ b/pidgin/plugins/disco/gtkdisco.c	Tue Dec 01 21:36:55 2009 +0000
@@ -225,8 +225,8 @@
 		gtk_widget_set_sensitive(dialog->account_widget, FALSE);
 
 	username = purple_account_get_username(dialog->account);
-	at = g_utf8_strchr(username, -1, '@');
-	slash = g_utf8_strchr(username, -1, '/');
+	at = strchr(username, -1, '@');
+	slash = strchr(username, -1, '/');
 	if (at && !slash) {
 		server = g_strdup_printf("%s", at + 1);
 	} else if (at && slash && at + 1 < slash) {