2 * @file purple-plugin.c
6 * Copyright (C) 2010 SIPE Project <http://sipe.sourceforge.net/>
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 #ifndef PURPLE_PLUGINS
31 #define PURPLE_PLUGINS
39 #include "sipe-common.h"
41 #include "accountopt.h"
47 #include "sipe-core-api.h"
48 #include "sipe-backend-debug.h"
50 #include "core-depurple.h"
52 void sipe_plugin_destroy(SIPE_UNUSED_PARAMETER PurplePlugin
*plugin
)
58 entry
= prpl_info
.protocol_options
;
60 purple_account_option_destroy(entry
->data
);
61 entry
= g_list_delete_link(entry
, entry
);
63 prpl_info
.protocol_options
= NULL
;
65 entry
= prpl_info
.user_splits
;
67 purple_account_user_split_destroy(entry
->data
);
68 entry
= g_list_delete_link(entry
, entry
);
70 prpl_info
.user_splits
= NULL
;
73 static void init_plugin(PurplePlugin
*plugin
)
75 PurpleAccountUserSplit
*split
;
76 PurpleAccountOption
*option
;
82 SIPE_DEBUG_INFO("bindtextdomain = %s",
83 bindtextdomain(PACKAGE_NAME
, LOCALEDIR
));
84 SIPE_DEBUG_INFO("bind_textdomain_codeset = %s",
85 bind_textdomain_codeset(PACKAGE_NAME
, "UTF-8"));
86 textdomain(PACKAGE_NAME
);
89 purple_plugin_register(plugin
);
91 split
= purple_account_user_split_new(_("Login\n user or DOMAIN\\user or\n user@company.com"), NULL
, ',');
92 purple_account_user_split_set_reverse(split
, FALSE
);
93 prpl_info
.user_splits
= g_list_append(prpl_info
.user_splits
, split
);
95 option
= purple_account_option_string_new(_("Server[:Port]\n(leave empty for auto-discovery)"), "server", "");
96 prpl_info
.protocol_options
= g_list_append(prpl_info
.protocol_options
, option
);
98 option
= purple_account_option_list_new(_("Connection type"), "transport", NULL
);
99 purple_account_option_add_list_item(option
, _("Auto"), "auto");
100 purple_account_option_add_list_item(option
, _("SSL/TLS"), "tls");
101 purple_account_option_add_list_item(option
, _("TCP"), "tcp");
102 purple_account_option_add_list_item(option
, _("UDP"), "udp");
103 prpl_info
.protocol_options
= g_list_append(prpl_info
.protocol_options
, option
);
105 /*option = purple_account_option_bool_new(_("Publish status (note: everyone may watch you)"), "doservice", TRUE);
106 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);*/
108 option
= purple_account_option_string_new(_("User Agent"), "useragent", "");
109 prpl_info
.protocol_options
= g_list_append(prpl_info
.protocol_options
, option
);
112 option
= purple_account_option_bool_new(_("Use Kerberos"), "krb5", FALSE
);
113 prpl_info
.protocol_options
= g_list_append(prpl_info
.protocol_options
, option
);
115 /* Suitable for sspi/NTLM, sspi/Kerberos and krb5 security mechanisms
116 * No login/password is taken into account if this option present,
117 * instead used default credentials stored in OS.
119 option
= purple_account_option_bool_new(_("Use Single Sign-On"), "sso", TRUE
);
120 prpl_info
.protocol_options
= g_list_append(prpl_info
.protocol_options
, option
);
123 option
= purple_account_option_list_new(_("Calendar source"), "calendar", NULL
);
124 purple_account_option_add_list_item(option
, _("Exchange 2007/2010"), "EXCH");
125 purple_account_option_add_list_item(option
, _("None"), "NONE");
126 prpl_info
.protocol_options
= g_list_append(prpl_info
.protocol_options
, option
);
128 /** Example: https://server.company.com/EWS/Exchange.asmx */
129 option
= purple_account_option_string_new(_("Email services URL\n(leave empty for auto-discovery)"), "email_url", "");
130 prpl_info
.protocol_options
= g_list_append(prpl_info
.protocol_options
, option
);
132 option
= purple_account_option_string_new(_("Email address\n(if different from Username)"), "email", "");
133 prpl_info
.protocol_options
= g_list_append(prpl_info
.protocol_options
, option
);
135 /** Example: DOMAIN\user or user@company.com */
136 option
= purple_account_option_string_new(_("Email login\n(if different from Login)"), "email_login", "");
137 prpl_info
.protocol_options
= g_list_append(prpl_info
.protocol_options
, option
);
139 option
= purple_account_option_string_new(_("Email password\n(if different from Password)"), "email_password", "");
140 purple_account_option_set_masked(option
, TRUE
);
141 prpl_info
.protocol_options
= g_list_append(prpl_info
.protocol_options
, option
);
144 PURPLE_INIT_PLUGIN(sipe
, init_plugin
, info
);