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");
56 encryption_values
= g_list_reverse(encryption_values
);
60 option
= purple_account_option_list_new(_("Connection security"), "connection_security", encryption_values
);
61 protocol
->account_options
= g_list_append(protocol
->account_options
,
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
,
70 option
= purple_account_option_int_new(_("Connect port"), "port", 5222);
71 protocol
->account_options
= g_list_append(protocol
->account_options
,
74 option
= purple_account_option_string_new(_("Connect server"),
75 "connect_server", NULL
);
76 protocol
->account_options
= g_list_append(protocol
->account_options
,
79 option
= purple_account_option_string_new(_("File transfer proxies"),
81 protocol
->account_options
= g_list_append(protocol
->account_options
,
84 option
= purple_account_option_string_new(_("BOSH URL"),
86 protocol
->account_options
= g_list_append(protocol
->account_options
,
89 /* this should probably be part of global smiley theme settings
92 option
= purple_account_option_bool_new(_("Show Custom Smileys"),
93 "custom_smileys", TRUE
);
94 protocol
->account_options
= g_list_append(protocol
->account_options
,
97 purple_prefs_remove("/plugins/prpl/jabber");
101 xmpp_protocol_class_init(PurpleProtocolClass
*klass
)
105 PURPLE_DEFINE_TYPE(XMPPProtocol
, xmpp_protocol
, JABBER_TYPE_PROTOCOL
);