http://telepathy.freedesktop.org/spec/Channel_Interface_Password.html
How do you feel about this API? /* Channel.Interface.Password */ #define TP_CHANNEL_FEATURE_PASSWORD \ tp_channel_get_feature_quark_password () GQuark tp_channel_get_feature_quark_password (void) G_GNUC_CONST; void tp_channel_password_provide_password_async (TpChannel *self, const gchar *password, GAsyncReadyCallback callback, gpointer user_data); gboolean tp_channel_password_provide_password_finish (TpChannel *self, GAsyncResult *result, GError **error); gboolean tp_channel_password_needed (TpChannel *self); /** * TpChannel:password-needed: * * If %TRUE, tp_channel_password_provide_password_async() has to be called * to be able to join the channel. * * This is not guaranteed to be meaningful until tp_proxy_prepare_async() has * finished preparing %TP_CHANNEL_FEATURE_PASSWORD; until then, it may return * %FALSE even if the channel is actually protected by a password. */ Maybe the provide async call should fail with TP_ERROR_AUTHENTICATION_FAILED if the password is not correct?
(In reply to comment #1) > gboolean tp_channel_password_provide_password_finish (TpChannel *self, > GAsyncResult *result, > GError **error); I meant: gboolean tp_channel_password_provide_password_finish (TpChannel *self, GAsyncResult *result, gboolean *correct, GError **error) except, of course, if we decide to fail if the pass was wrong.
(In reply to comment #1) > /** > * TpChannel:password-needed: > * > * If %TRUE, tp_channel_password_provide_password_async() has to be called > * to be able to join the channel. > * > * This is not guaranteed to be meaningful until tp_proxy_prepare_async() has > * finished preparing %TP_CHANNEL_FEATURE_PASSWORD; until then, it may return > * %FALSE even if the channel is actually protected by a password. > */ For completeness, presumably this emits notify::password-needed when appropriate? (If so, it's worth mentioning that in the docstring.) > Maybe the provide async call should fail with TP_ERROR_AUTHENTICATION_FAILED if > the password is not correct? I like this better than the "out" boolean. I'm not sure why we didn't do this in the D-Bus API... (Looking at the D-Bus API again, I'm also not sure why ProvidePassword claims to be able to raise InvalidArgument.)
Created attachment 47137 [details] [review] textchan-group: implement Password
Created attachment 47138 [details] [review] TpChannel: add high-level API for Password (#37360)
Created attachment 47139 [details] [review] automatic-proxy-factory: prepare TP_CHANNEL_FEATURE_PASSWORD
Looks good to me.
Merged to master; will be in 0.15.2
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.