Mercurial > pidgin.yaz
comparison src/protocols/jabber/chat.c @ 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 | 4a8bf81b82ae |
children | 3f97624e7753 |
comparison
equal
deleted
inserted
replaced
9759:b64ee81c7bcb | 9760:cee4e4cae56a |
---|---|
65 } | 65 } |
66 | 66 |
67 GHashTable *jabber_chat_info_defaults(GaimConnection *gc, const char *chat_name) | 67 GHashTable *jabber_chat_info_defaults(GaimConnection *gc, const char *chat_name) |
68 { | 68 { |
69 GHashTable *defaults; | 69 GHashTable *defaults; |
70 gchar **name_split; | |
71 | 70 |
72 defaults = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free); | 71 defaults = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, g_free); |
73 | 72 |
74 if (chat_name != NULL) { | 73 if (chat_name != NULL) { |
75 name_split = g_strsplit(chat_name, "@", 2); | 74 JabberID *jid = jabber_id_new(chat_name); |
76 g_hash_table_insert(defaults, "room", g_strdup(name_split[0])); | 75 if(jid) { |
77 if (name_split[1] != NULL) | 76 g_hash_table_insert(defaults, "room", g_strdup(jid->node)); |
78 g_hash_table_insert(defaults, "server", g_strdup(name_split[1])); | 77 if(jid->domain) |
79 g_strfreev(name_split); | 78 g_hash_table_insert(defaults, "server", g_strdup(jid->domain)); |
79 jabber_id_free(jid); | |
80 } | |
80 } | 81 } |
81 | 82 |
82 return defaults; | 83 return defaults; |
83 } | 84 } |
84 | 85 |