Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/jabber.c @ 30276:417a4e912738
jabber: I never understood why this was in auth.c anyway...
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sat, 01 May 2010 18:09:16 +0000 |
parents | 3a5194c70b38 |
children | 77aba27f64da 92a5d4b38f21 |
comparison
equal
deleted
inserted
replaced
30275:3a5194c70b38 | 30276:417a4e912738 |
---|---|
206 * whole FQDN in the hostname */ | 206 * whole FQDN in the hostname */ |
207 if((dot = strchr(hostname, '.'))) | 207 if((dot = strchr(hostname, '.'))) |
208 dot = '\0'; | 208 dot = '\0'; |
209 | 209 |
210 return purple_strreplace(input, "__HOSTNAME__", hostname); | 210 return purple_strreplace(input, "__HOSTNAME__", hostname); |
211 } | |
212 | |
213 static gboolean | |
214 jabber_process_starttls(JabberStream *js, xmlnode *packet) | |
215 { | |
216 PurpleAccount *account; | |
217 xmlnode *starttls; | |
218 | |
219 account = purple_connection_get_account(js->gc); | |
220 | |
221 if((starttls = xmlnode_get_child(packet, "starttls"))) { | |
222 if(purple_ssl_is_supported()) { | |
223 jabber_send_raw(js, | |
224 "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>", -1); | |
225 return TRUE; | |
226 } else if(xmlnode_get_child(starttls, "required")) { | |
227 purple_connection_error_reason(js->gc, | |
228 PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, | |
229 _("Server requires TLS/SSL, but no TLS/SSL support was found.")); | |
230 return TRUE; | |
231 } else if(purple_account_get_bool(account, "require_tls", JABBER_DEFAULT_REQUIRE_TLS)) { | |
232 purple_connection_error_reason(js->gc, | |
233 PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, | |
234 _("You require encryption, but no TLS/SSL support was found.")); | |
235 return TRUE; | |
236 } | |
237 } | |
238 | |
239 return FALSE; | |
211 } | 240 } |
212 | 241 |
213 void jabber_stream_features_parse(JabberStream *js, xmlnode *packet) | 242 void jabber_stream_features_parse(JabberStream *js, xmlnode *packet) |
214 { | 243 { |
215 if(xmlnode_get_child(packet, "starttls")) { | 244 if(xmlnode_get_child(packet, "starttls")) { |