Migrate certificates, icons, logs to XDG dirs
[pidgin-git.git] / libpurple / protocols / jabber / xmpp.c
blob109dbb32026a60496da275d0f0bc33ba49a88ebc
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 #if 0
57 ADD_VALUE(encryption_values, "None", "none");
58 #endif
59 encryption_values = g_list_reverse(encryption_values);
61 #undef ADD_VALUE
63 option = purple_account_option_list_new(_("Connection security"), "connection_security", encryption_values);
64 protocol->account_options = g_list_append(protocol->account_options,
65 option);
67 option = purple_account_option_bool_new(
68 _("Allow plaintext auth over unencrypted streams"),
69 "auth_plain_in_clear", FALSE);
70 protocol->account_options = g_list_append(protocol->account_options,
71 option);
73 option = purple_account_option_int_new(_("Connect port"), "port", 5222);
74 protocol->account_options = g_list_append(protocol->account_options,
75 option);
77 option = purple_account_option_string_new(_("Connect server"),
78 "connect_server", NULL);
79 protocol->account_options = g_list_append(protocol->account_options,
80 option);
82 option = purple_account_option_string_new(_("File transfer proxies"),
83 "ft_proxies", NULL);
84 protocol->account_options = g_list_append(protocol->account_options,
85 option);
87 option = purple_account_option_string_new(_("BOSH URL"),
88 "bosh_url", NULL);
89 protocol->account_options = g_list_append(protocol->account_options,
90 option);
92 /* this should probably be part of global smiley theme settings later on,
93 shared with MSN */
94 option = purple_account_option_bool_new(_("Show Custom Smileys"),
95 "custom_smileys", TRUE);
96 protocol->account_options = g_list_append(protocol->account_options,
97 option);
99 purple_prefs_remove("/plugins/prpl/jabber");
102 static void
103 xmpp_protocol_class_init(PurpleProtocolClass *klass)
107 PURPLE_DEFINE_TYPE(XMPPProtocol, xmpp_protocol, JABBER_TYPE_PROTOCOL);