After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 636613 - Become a server SASL handler
Become a server SASL handler
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Accounts
unspecified
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
Depends on:
Blocks: 586562
 
 
Reported: 2010-12-06 16:29 UTC by Jonny Lamb
Modified: 2010-12-07 11:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
diff (50.32 KB, patch)
2010-12-07 09:57 UTC, Guillaume Desmottes
reviewed Details | Review

Description Jonny Lamb 2010-12-06 16:29:31 UTC
All this branch does for now is handle SASL channels with mechanism X-TELEPATHY-PASSWORD (haze git master). Saving passwords is currently not implemented as it is blocked on a spec bug (yet to be filed). I'll fix up these things when the spec has these things fixed, but there's really no reason why this can't be merged now.

http://git.collabora.co.uk/?p=user/jonny/empathy.git;a=shortlog;h=refs/heads/sasl

Give it a go! Have some fun!;
Comment 1 Jonny Lamb 2010-12-06 16:30:31 UTC
You can probably make the "make passwords optional" bug depend on this one.
Comment 2 Guillaume Desmottes 2010-12-07 09:57:54 UTC
Created attachment 175994 [details] [review]
diff

Attaching diff for review.
Comment 3 Guillaume Desmottes 2010-12-07 10:58:18 UTC
Review of attachment 175994 [details] [review]:

The branch looks pretty. Code is clear and commits are nicely separated. Good work!
I just have few general questions and spotted some coding style errors.

Does the branch pass "make check"?

Shouldn't EmpathyServerSASLHandler be a TpChannel subclass? I know it's not doable atm because we can't define our own features (vote for fdo #31583 !) but that's the idea right?

Isn't http://git.collabora.co.uk/?p=user/jonny/empathy.git;a=commitdiff;h=ee8f480f660963c7d26872a27ba9889bbed6a000 a bit overkill? Why not just use gtk_widget_grab_focus() like we always do?

::: libempathy/empathy-server-sasl-handler.c
@@ +58,3 @@
+    G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, async_initable_iface_init));
+
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyServerSASLHandler);

I'm trying to get rid of this pattern in new code. Please use self->priv

@@ +194,3 @@
+  priv = GET_PRIV (object);
+
+  tp_cli_channel_interface_sasl_authentication_connect_to_sasl_status_changed (priv->channel,

line is too long

@@ +407,3 @@
+
+  tp_cli_channel_interface_sasl_authentication_call_start_mechanism_with_data (
+      priv->channel, -1, "X-TELEPATHY-PASSWORD", array, start_mechanism_with_data_cb,

This line is too long.
Comment 4 Jonny Lamb 2010-12-07 11:15:17 UTC
(In reply to comment #3)
> The branch looks pretty. Code is clear and commits are nicely separated. Good
> work!

Woo, thanks!

> Does the branch pass "make check"?

It does now. :-)

> Shouldn't EmpathyServerSASLHandler be a TpChannel subclass? I know it's not
> doable atm because we can't define our own features (vote for fdo #31583 !) but
> that's the idea right?

I'm not sure. The handler is quite a bit more than just a proxy to a DBus object but it completely handles the SASL mechanism as well as poking the password in and out of the keyring. Hmm.

> Isn't
> http://git.collabora.co.uk/?p=user/jonny/empathy.git;a=commitdiff;h=ee8f480f660963c7d26872a27ba9889bbed6a000
> a bit overkill? Why not just use gtk_widget_grab_focus() like we always do?

Oh this is quite different. This doesn't just grab the focus when it first appears (which is done by gtk_widget_grab_focus at the end of constructed) but it ensures that you can't type anything without it appearing in the password dialog. I really like this feature in seahorse as it means I don't end up typing my password/passphrase into an IRC window because I moved my mouse (focus follows mouse). Am I making sense?

> I'm trying to get rid of this pattern in new code. Please use self->priv

Oh awesome! I felt a little bad using it! Done.

> line is too long

Fixed.

> This line is too long.

Fixed.

Okay I updated my branch with a few commits. It's in the same place. Thanks for your review!
Comment 5 Guillaume Desmottes 2010-12-07 11:53:23 UTC
(In reply to comment #4)
> > Shouldn't EmpathyServerSASLHandler be a TpChannel subclass? I know it's not
> > doable atm because we can't define our own features (vote for fdo #31583 !) but
> > that's the idea right?
> 
> I'm not sure. The handler is quite a bit more than just a proxy to a DBus
> object but it completely handles the SASL mechanism as well as poking the
> password in and out of the keyring. Hmm.

Maybe yeah, anyway, that can wait.

> > Isn't
> > http://git.collabora.co.uk/?p=user/jonny/empathy.git;a=commitdiff;h=ee8f480f660963c7d26872a27ba9889bbed6a000
> > a bit overkill? Why not just use gtk_widget_grab_focus() like we always do?
> 
> Oh this is quite different. This doesn't just grab the focus when it first
> appears (which is done by gtk_widget_grab_focus at the end of constructed) but
> it ensures that you can't type anything without it appearing in the password
> dialog. I really like this feature in seahorse as it means I don't end up
> typing my password/passphrase into an IRC window because I moved my mouse
> (focus follows mouse). Am I making sense?

I see, thanks for the explanation.

Go go merge !
Comment 6 Jonny Lamb 2010-12-07 11:56:58 UTC
Woo, thanks!