comparison libpurple/protocols/jabber/jabber.c @ 25871:65cfc59858cf

propagate from branch 'im.pidgin.pidgin' (head d5bb29138cbe033bbfd8ec689203d73818765327) to branch 'im.pidgin.pidgin.next.minor' (head 35ee8e40db640867e5b9239030cdc326e7f0a005)
author Gary Kramlich <grim@reaperworld.com>
date Sat, 13 Dec 2008 05:45:27 +0000
parents aa1fe87558d8 641fe4c2b2a5
children
comparison
equal deleted inserted replaced
25870:d9da15c9e2a1 25871:65cfc59858cf
152 /* Empty resource == don't send any */ 152 /* Empty resource == don't send any */
153 if (*input == '\0') 153 if (*input == '\0')
154 return NULL; 154 return NULL;
155 155
156 if (strstr(input, "__HOSTNAME__") == NULL) 156 if (strstr(input, "__HOSTNAME__") == NULL)
157 return input; 157 return g_strdup(input);
158 158
159 /* Replace __HOSTNAME__ with hostname */ 159 /* Replace __HOSTNAME__ with hostname */
160 if (gethostname(hostname, sizeof(hostname) - 1)) { 160 if (gethostname(hostname, sizeof(hostname) - 1)) {
161 purple_debug_warning("jabber", "gethostname: %s\n", g_strerror(errno)); 161 purple_debug_warning("jabber", "gethostname: %s\n", g_strerror(errno));
162 /* according to glibc doc, the only time an error is returned 162 /* according to glibc doc, the only time an error is returned
198 requested_resource = jabber_prep_resource(js->user->resource); 198 requested_resource = jabber_prep_resource(js->user->resource);
199 199
200 if (requested_resource != NULL) { 200 if (requested_resource != NULL) {
201 resource = xmlnode_new_child(bind, "resource"); 201 resource = xmlnode_new_child(bind, "resource");
202 xmlnode_insert_data(resource, requested_resource, -1); 202 xmlnode_insert_data(resource, requested_resource, -1);
203 free(requested_resource); 203 g_free(requested_resource);
204 } 204 }
205 205
206 jabber_iq_set_callback(iq, jabber_bind_result_cb, NULL); 206 jabber_iq_set_callback(iq, jabber_bind_result_cb, NULL);
207 207
208 jabber_iq_send(iq); 208 jabber_iq_send(iq);