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
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
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");
57 ADD_VALUE(encryption_values
, "None", "none");
59 encryption_values
= g_list_reverse(encryption_values
);
63 option
= purple_account_option_list_new(_("Connection security"), "connection_security", encryption_values
);
64 protocol
->account_options
= g_list_append(protocol
->account_options
,
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
,
73 option
= purple_account_option_int_new(_("Connect port"), "port", 5222);
74 protocol
->account_options
= g_list_append(protocol
->account_options
,
77 option
= purple_account_option_string_new(_("Connect server"),
78 "connect_server", NULL
);
79 protocol
->account_options
= g_list_append(protocol
->account_options
,
82 option
= purple_account_option_string_new(_("File transfer proxies"),
84 protocol
->account_options
= g_list_append(protocol
->account_options
,
87 option
= purple_account_option_string_new(_("BOSH URL"),
89 protocol
->account_options
= g_list_append(protocol
->account_options
,
92 /* this should probably be part of global smiley theme settings later on,
94 option
= purple_account_option_bool_new(_("Show Custom Smileys"),
95 "custom_smileys", TRUE
);
96 protocol
->account_options
= g_list_append(protocol
->account_options
,
99 purple_prefs_remove("/plugins/prpl/jabber");
103 xmpp_protocol_class_init(PurpleProtocolClass
*klass
)
107 PURPLE_DEFINE_TYPE(XMPPProtocol
, xmpp_protocol
, JABBER_TYPE_PROTOCOL
);