Bug 24762 - Shouldn't expose so much internal stuff to its plugin API
Summary: Shouldn't expose so much internal stuff to its plugin API
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: mission-control (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Simon McVittie
QA Contact: Telepathy bugs list
URL: http://cgit.freedesktop.org/~smcv/tel...
Whiteboard: r+
Keywords: patch
Depends on: 25715 27363 27364 27633
Blocks:
  Show dependency treegraph
 
Reported: 2009-10-27 10:12 UTC by Simon McVittie
Modified: 2012-05-14 07:01 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Simon McVittie 2009-10-27 10:12:37 UTC
At the moment MC has a very large plugin API, which we can't keep stable for very long at a time due to internal refactoring; as a result, we've turned off plugin support in Debian and recommend that all distributions do the same. This is basically rubbish.

My mini-plugins branch sketches out a GInterface-based API which could replace this; it's not currently active, because I haven't put the necessary glue into src/ to implement the GInterfaces and invoke plugins at the right times.

General design:

* McpRequest and McpDispatchOperation are implemented via an uninstalled header (implementation.h), so only MC can implement them
* McpRequestPolicy and McpDispatchOperationPolicy are implemented by plugins; they use the "hidden vtable" trick from telepathy-glib, to be expandable (obviously, any functions we add later would have to have sensible behaviour if left unimplemented - "do nothing", probably)
* mcp_plugin_ref_nth_object() is implemented by plugins and allows the plugin to return one or more objects that implement McpRequestPolicy and/or McpDispatchOperationPolicy

<http://git.collabora.co.uk/?p=user/smcv/telepathy-mission-control-smcv.git;a=shortlog;h=refs/heads/mini-plugins>

Not tagging 'patch' since it's just a sketch at the moment.
Comment 1 Simon McVittie 2009-11-03 15:02:26 UTC
Two branches for review. I'm not very happy with the test coverage stats for these branches, but they do seem to work...
Comment 2 Simon McVittie 2010-01-21 12:33:30 UTC
Vivek has reviewed smcv/dispatcher-plugin and smcv/request-plugin, and has no complaints except that it's not clear how to actually write a plugin :-)

This branch adds a bit of documentation for everything except McpRequest:

http://git.collabora.co.uk/?p=user/smcv/telepathy-mission-control-smcv.git;a=shortlog;h=refs/heads/plugin-doc

I plan to document McpRequest after the branch smcv/requests has been merged, since that branch makes McpRequest significantly more capable (it adds the ability to delay requests, an older API for which is used in Maemo 5 to delay requests until the user has been prompted to exit offline mode).

--------

Subsequent things to do to close this bug:

* get smcv/requests reviewed and merged: http://git.collabora.co.uk/?p=user/smcv/telepathy-mission-control-smcv.git;a=shortlog;h=refs/heads/requests

* document McpRequest

* let plugins influence how accounts are stored (goal: turn gnome-keyring integration, and similar concepts in Maemo 5, into plugins)

* work out how to turn the connectivity API (as used in Maemo 5) into a plugin too
Comment 3 Simon McVittie 2010-03-29 04:55:39 UTC
Repurposing this as a metabug.
Comment 4 Simon McVittie 2010-03-29 05:04:10 UTC
(In reply to comment #2)
> * get smcv/requests reviewed and merged:
> http://git.collabora.co.uk/?p=user/smcv/telepathy-mission-control-smcv.git;a=shortlog;h=refs/heads/requests

Bug #25715

> * document McpRequest

Cloned as Bug #27363

> * let plugins influence how accounts are stored (goal: turn gnome-keyring
> integration, and similar concepts in Maemo 5, into plugins)

Done, by Vivek

> * work out how to turn the connectivity API (as used in Maemo 5) into a plugin
> too

Cloned as Bug #27364
Comment 6 Simon McVittie 2012-05-08 07:48:21 UTC
I started removing deprecated telepathy-glib things from MC, and then got carried away and deleted (among other things) all the mcd_* stuff, some remnants of ContactCapabilities.DRAFT1, and Capabilities (ContactCapabilities' predecessor).

 85 files changed, 276 insertions(+), 4202 deletions(-)
Comment 7 Simon McVittie 2012-05-08 09:42:19 UTC
I've split out Bug #49648, Bug #24899, Bug #24914 to make the branch a little less intimidating. It's now

 46 files changed, 121 insertions(+), 3629 deletions(-)
Comment 8 Jonny Lamb 2012-05-09 09:32:22 UTC
I'm not sure about some of this inlining. Keeping code paths in separate functions is nice. Never mind though.

(In reply to comment #7)
>  46 files changed, 121 insertions(+), 3629 deletions(-)

Very impressive.

I assume stuff still passes, so r+.
Comment 9 Simon McVittie 2012-05-10 12:22:10 UTC
Thanks, fixed in git for 5.13.0


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.