Mercurial > pidgin
changeset 9760:cee4e4cae56a
[gaim-migrate @ 10628]
better way to split a jid
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sun, 15 Aug 2004 23:24:14 +0000 |
parents | b64ee81c7bcb |
children | 391e4e186708 |
files | src/protocols/jabber/chat.c |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/protocols/jabber/chat.c Sun Aug 15 23:09:53 2004 +0000 +++ b/src/protocols/jabber/chat.c Sun Aug 15 23:24:14 2004 +0000 @@ -67,16 +67,17 @@ GHashTable *jabber_chat_info_defaults(GaimConnection *gc, const char *chat_name) { GHashTable *defaults; - gchar **name_split; defaults = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free); if (chat_name != NULL) { - name_split = g_strsplit(chat_name, "@", 2); - g_hash_table_insert(defaults, "room", g_strdup(name_split[0])); - if (name_split[1] != NULL) - g_hash_table_insert(defaults, "server", g_strdup(name_split[1])); - g_strfreev(name_split); + JabberID *jid = jabber_id_new(chat_name); + if(jid) { + g_hash_table_insert(defaults, "room", g_strdup(jid->node)); + if(jid->domain) + g_hash_table_insert(defaults, "server", g_strdup(jid->domain)); + jabber_id_free(jid); + } } return defaults;