Replace functions which called once with their bodies
[pidgin-git.git] / libpurple / protocols / jabber / auth_webex.c
blob6516ed274d163f42f6ea4790a25bce379f0094d3
1 /*
2 * purple - Jabber Protocol Plugin
4 * Purple is the legal property of its developers, whose names are too numerous
5 * to list here. Please refer to the COPYRIGHT file distributed with this
6 * source distribution.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
23 #include "internal.h"
25 #include "account.h"
26 #include "debug.h"
27 #include "request.h"
28 #include "util.h"
29 #include "xmlnode.h"
31 #include "jabber.h"
32 #include "auth.h"
34 static PurpleXmlNode *finish_webex_authentication(JabberStream *js)
36 PurpleXmlNode *auth;
38 auth = purple_xmlnode_new("auth");
39 purple_xmlnode_set_namespace(auth, NS_XMPP_SASL);
41 purple_xmlnode_set_attrib(auth, "xmlns:ga", "http://www.google.com/talk/protocol/auth");
42 purple_xmlnode_set_attrib(auth, "ga:client-uses-full-bind-result", "true");
44 purple_xmlnode_set_attrib(auth, "mechanism", "WEBEX-TOKEN");
45 purple_xmlnode_insert_data(auth, purple_connection_get_password(js->gc), -1);
47 return auth;
50 static JabberSaslState
51 jabber_webex_start(JabberStream *js, PurpleXmlNode *packet, PurpleXmlNode **response, char **error)
53 *response = finish_webex_authentication(js);
54 return JABBER_SASL_STATE_OK;
57 static JabberSaslMech webex_token_mech = {
58 101, /* priority */
59 "WEBEX-TOKEN", /* name */
60 jabber_webex_start,
61 NULL, /* handle_challenge */
62 NULL, /* handle_success */
63 NULL, /* handle_failure */
64 NULL /* dispose */
67 JabberSaslMech *jabber_auth_get_webex_token_mech(void)
69 return &webex_token_mech;