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 673263 - goa-mc-plugin: support enabling or disabling accounts
goa-mc-plugin: support enabling or disabling accounts
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: General
3.3.x
Other All
: Normal enhancement
: ---
Assigned To: empathy-maint
empathy-maint
Depends on: 657905
Blocks:
 
 
Reported: 2012-03-31 21:36 UTC by Debarshi Ray
Modified: 2012-05-07 13:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
goa-mc-plugin: fix variable name (825 bytes, patch)
2012-03-31 21:37 UTC, Debarshi Ray
committed Details | Review
goa-mc-plugin: support enabling or disabling accounts (2.80 KB, patch)
2012-03-31 21:52 UTC, Debarshi Ray
reviewed Details | Review
goa-mc-plugin: support enabling or disabling accounts (2.79 KB, patch)
2012-04-02 12:49 UTC, Debarshi Ray
accepted-commit_now Details | Review
goa-mc-plugin: support enabling or disabling accounts (2.77 KB, patch)
2012-04-03 08:11 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2012-03-31 21:36:03 UTC
GOA is now going to offer API to let applications enable or disable the specific components (eg., mail, chat, etc.) of an account: https://bugzilla.gnome.org/657905

Would be good if goa-mc-plugin started using this API.
Comment 1 Debarshi Ray 2012-03-31 21:37:32 UTC
Created attachment 211046 [details] [review]
goa-mc-plugin: fix variable name

I have no idea how this was compiling. :-)
Comment 2 Debarshi Ray 2012-03-31 21:52:56 UTC
Created attachment 211047 [details] [review]
goa-mc-plugin: support enabling or disabling accounts

Currently, if you toggle the account through the GOA panel, it will take a little while to show up in empathy-accounts.

This is because we are watching the availability of the GoaChat interface (indicated by notify::chat) instead of the chat-disabled property of GoaAccount. When any other application (eg., the panel) toggles the chat-disabled property the ~/.config/goa-1.0/accounts.conf gets updated. Whenever the file changes, the daemon updates the GoaObject after a timeout of 200 ms, and hence the lag.

Currently this is easy to fix by just using notify::chat-disabled instead of notify::chat because the GoaChat interface is currently useless. However, in future when GOA starts providing metadata about chat accounts through the GoaChat interface, you will actually need it (think generic Jabber or SIP accounts).

The lag is probably not so much of a practical problem. So I am keeping it simple at the moment.
Comment 3 Guillaume Desmottes 2012-04-02 09:05:12 UTC
Review of attachment 211046 [details] [review]:

Oh good catch! It was building because 'acct' is a global variable defined in some other libs. The GOA plugin was not built with the usual warnings so we didn't notice. I'm fixing that in 3.4; I'll merge your patch with my branch. thanks!
Comment 4 Guillaume Desmottes 2012-04-02 09:08:02 UTC
Comment on attachment 211046 [details] [review]
goa-mc-plugin: fix variable name

Attachment 211046 [details] pushed as 0d03cd1 - goa-mc-plugin: fix variable name
Comment 5 Guillaume Desmottes 2012-04-02 09:13:19 UTC
Review of attachment 211047 [details] [review]:

Looks good to me; but you'll probably have to rebase it on top of master and I renamed the acct variable to fix shadow variables warnings.
Comment 6 Debarshi Ray 2012-04-02 11:38:23 UTC
(In reply to comment #3)
> Review of attachment 211046 [details] [review]:
> 
> Oh good catch! It was building because 'acct' is a global variable defined in
> some other libs. The GOA plugin was not built with the usual warnings so we
> didn't notice. I'm fixing that in 3.4; I'll merge your patch with my branch.
> thanks!

That is what I thought, but who would be exporting a variable with the usual namespace prefix? 'gcc -E' will help in narrowing that down.
Comment 7 Debarshi Ray 2012-04-02 12:49:08 UTC
Created attachment 211133 [details] [review]
goa-mc-plugin: support enabling or disabling accounts

Rebased on master.
Comment 8 Guillaume Desmottes 2012-04-02 12:52:32 UTC
Review of attachment 211133 [details] [review]:

Looks good. Feel free to merge to master once the GOA bits have been released. Don't forget to bump the GOA dep in configure.ac first

::: goa-mc-plugin/mcp-account-manager-goa.c
@@ +485,3 @@
+        return FALSE;
+
+      acct = goa_object_peek_account (object);

you can just do "goa_account_set_chat_disabled (acct, tp_strdiff (val, "true") );
Comment 9 Debarshi Ray 2012-04-03 08:11:21 UTC
Created attachment 211203 [details] [review]
goa-mc-plugin: support enabling or disabling accounts

Good suggestion.
Comment 10 Guillaume Desmottes 2012-04-03 09:31:19 UTC
Review of attachment 211203 [details] [review]:

++ please merge once GOA has been released.
Comment 11 Debarshi Ray 2012-05-07 13:21:20 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.