Standardize all protocol header guard macros.
[pidgin-git.git] / libpurple / protocols / jabber / xmpp.c
blob31ff04db343dcd8c54c2179093acc594e3543ee6
1 /* purple
3 * Purple is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
5 * source distribution.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
23 #include "internal.h"
24 #include "chat.h"
25 #include "core.h"
26 #include "plugins.h"
28 #include "xmpp.h"
30 static void
31 xmpp_protocol_init(PurpleProtocol *protocol)
33 PurpleAccountUserSplit *split;
34 PurpleAccountOption *option;
35 GList *encryption_values = NULL;
37 /* Translators: 'domain' is used here in the context of Internet domains, e.g. pidgin.im */
38 split = purple_account_user_split_new(_("Domain"), NULL, '@');
39 purple_account_user_split_set_reverse(split, FALSE);
40 protocol->user_splits = g_list_append(protocol->user_splits, split);
42 split = purple_account_user_split_new(_("Resource"), "", '/');
43 purple_account_user_split_set_reverse(split, FALSE);
44 protocol->user_splits = g_list_append(protocol->user_splits, split);
46 #define ADD_VALUE(list, desc, v) { \
47 PurpleKeyValuePair *kvp = g_new0(PurpleKeyValuePair, 1); \
48 kvp->key = g_strdup((desc)); \
49 kvp->value = g_strdup((v)); \
50 list = g_list_prepend(list, kvp); \
53 ADD_VALUE(encryption_values, _("Require encryption"), "require_tls");
54 ADD_VALUE(encryption_values, _("Use encryption if available"), "opportunistic_tls");
55 ADD_VALUE(encryption_values, _("Use old-style SSL"), "old_ssl");
56 encryption_values = g_list_reverse(encryption_values);
58 #undef ADD_VALUE
60 option = purple_account_option_list_new(_("Connection security"), "connection_security", encryption_values);
61 protocol->account_options = g_list_append(protocol->account_options,
62 option);
64 option = purple_account_option_bool_new(
65 _("Allow plaintext auth over unencrypted streams"),
66 "auth_plain_in_clear", FALSE);
67 protocol->account_options = g_list_append(protocol->account_options,
68 option);
70 option = purple_account_option_int_new(_("Connect port"), "port", 5222);
71 protocol->account_options = g_list_append(protocol->account_options,
72 option);
74 option = purple_account_option_string_new(_("Connect server"),
75 "connect_server", NULL);
76 protocol->account_options = g_list_append(protocol->account_options,
77 option);
79 option = purple_account_option_string_new(_("File transfer proxies"),
80 "ft_proxies", NULL);
81 protocol->account_options = g_list_append(protocol->account_options,
82 option);
84 option = purple_account_option_string_new(_("BOSH URL"),
85 "bosh_url", NULL);
86 protocol->account_options = g_list_append(protocol->account_options,
87 option);
89 /* this should probably be part of global smiley theme settings
90 * later on
92 option = purple_account_option_bool_new(_("Show Custom Smileys"),
93 "custom_smileys", TRUE);
94 protocol->account_options = g_list_append(protocol->account_options,
95 option);
97 purple_prefs_remove("/plugins/prpl/jabber");
100 static void
101 xmpp_protocol_class_init(PurpleProtocolClass *klass)
105 PURPLE_DEFINE_TYPE(XMPPProtocol, xmpp_protocol, JABBER_TYPE_PROTOCOL);