aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-event-manager.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2011-10-01 19:08:11 +0800
committerXavier Claessens <xclaesse@gmail.com>2011-10-01 19:08:11 +0800
commitc7fe998d565bd37ed066e1fee0e7281c7f6117ce (patch)
tree68db0dd3ede4bb3e26a35d99f0a0a0a05eaad93f /src/empathy-event-manager.c
parent05e20d8450559ccd579dbc5f268804611438e300 (diff)
downloadgsoc2013-empathy-c7fe998d565bd37ed066e1fee0e7281c7f6117ce.tar
gsoc2013-empathy-c7fe998d565bd37ed066e1fee0e7281c7f6117ce.tar.gz
gsoc2013-empathy-c7fe998d565bd37ed066e1fee0e7281c7f6117ce.tar.bz2
gsoc2013-empathy-c7fe998d565bd37ed066e1fee0e7281c7f6117ce.tar.lz
gsoc2013-empathy-c7fe998d565bd37ed066e1fee0e7281c7f6117ce.tar.xz
gsoc2013-empathy-c7fe998d565bd37ed066e1fee0e7281c7f6117ce.tar.zst
gsoc2013-empathy-c7fe998d565bd37ed066e1fee0e7281c7f6117ce.zip
Do not should "password required" if X-TELEPATHY-PASSWORD is not supported
Messenger XMPP only supports auth via an access token, no password
Diffstat (limited to 'src/empathy-event-manager.c')
-rw-r--r--src/empathy-event-manager.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index 79b1f60cb..da677d42d 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -1128,10 +1128,31 @@ approve_channels (TpSimpleApprover *approver,
}
else if (channel_type == TP_IFACE_QUARK_CHANNEL_TYPE_SERVER_AUTHENTICATION)
{
- event_manager_add (approval->manager, account, NULL, EMPATHY_EVENT_TYPE_AUTH,
- GTK_STOCK_DIALOG_AUTHENTICATION, tp_account_get_display_name (account),
- _("Password required"), approval,
- event_manager_auth_process_func, NULL);
+ GHashTable *props;
+ const gchar * const *available_mechanisms;
+
+ props = tp_channel_borrow_immutable_properties (channel);
+ available_mechanisms = tp_asv_get_boxed (props,
+ TP_PROP_CHANNEL_INTERFACE_SASL_AUTHENTICATION_AVAILABLE_MECHANISMS,
+ G_TYPE_STRV);
+
+ if (tp_strv_contains (available_mechanisms, "X-TELEPATHY-PASSWORD"))
+ {
+ event_manager_add (approval->manager, account, NULL,
+ EMPATHY_EVENT_TYPE_AUTH,
+ GTK_STOCK_DIALOG_AUTHENTICATION,
+ tp_account_get_display_name (account),
+ _("Password required"), approval,
+ event_manager_auth_process_func, NULL);
+ }
+ else
+ {
+ GError error = { TP_ERRORS, TP_ERROR_NOT_IMPLEMENTED,
+ "Support only X-TELEPATHY-PASSWORD auth method" };
+
+ tp_add_dispatch_operation_context_fail (context, &error);
+ return;
+ }
}
else
{