# HG changeset patch # User Paul Aurich # Date 1250920818 0 # Node ID 2c85f44113b41cace48036183a11ecc74fb6ce81 # Parent 15833e4f2e0997fffe0f13e7431168df172fd45a jabber: Strip the '/' off of a JID in jabber_normalize. This is what Pidgin did pre-2.6.0 and breaks the log directories for accounts with no resource. Closes #9959. diff -r 15833e4f2e09 -r 2c85f44113b4 libpurple/protocols/jabber/jutil.c --- a/libpurple/protocols/jabber/jutil.c Sat Aug 22 05:38:56 2009 +0000 +++ b/libpurple/protocols/jabber/jutil.c Sat Aug 22 06:00:18 2009 +0000 @@ -506,8 +506,23 @@ JabberStream *js = gc ? gc->proto_data : NULL; static char buf[3072]; /* maximum legal length of a jabber jid */ JabberID *jid; + char *tmp; + size_t len = strlen(in); - jid = jabber_id_new(in); + /* + * If the JID ends with a '/', jabber_id_new is going to throw it away as + * invalid. However, this is what the UI generates for a JID with no + * resource. Deal with that by dropping away the '/'... + */ + if (in[len - 1] == '/') + tmp = g_strndup(in, len - 1); + else + tmp = (gchar *)in; + + jid = jabber_id_new(tmp); + + if (tmp != in) + g_free(tmp); if(!jid) return NULL;