It's so easy for .client files and the TpBaseClient to get out of sync, causing havoc. It would be nice if you could simply create a TpBaseClient from a .client file. Proposed API: TpBaseClient * tp_base_client_new_from_client_file (const char *filename, TpSimpleObserverObserveChannelsImpl observe_channels, TpSimpleApproverAddDispatchOperationImpl add_dispatch_op, TpSimpleHandlerHandleChannelsImpl handle_channels, gpointer user_data, GDestroyNotify destroy); If observe_channels, add_dispatch_op or handle_channels were defined, and the .client file did not define that type of client, there could be a WARNING. All properties such as name, recover, delay_approvers, the filters and capabilities would all be learned from the .client file. The uniquify property would clearly always be FALSE (you don't want a unique name for a registered client).
I've actually just implemented the reverse: a little Python program which introspects a running client and spits out a .client file. http://cgit.collabora.com/git/user/wjt/telepathy-glib/commit/?h=generate-client-file The output looks kosher… it remains to be seen whether it works. I will find this out shortly…
Created attachment 58833 [details] write-manager-file.py FWIW I wrote something similar to generate .manager files. Although I suspect it would be a pain in the neck to use when cross-compiling.
(In reply to comment #2) > Created attachment 58833 [details] > write-manager-file.py > > FWIW I wrote something similar to generate .manager files. Although I suspect > it would be a pain in the neck to use when cross-compiling. I already wrote one of those, but it lives in tp-python. http://cgit.freedesktop.org/telepathy/telepathy-python/tree/examples/generate-manager-file.py Yours is much more complete.
(In reply to comment #2) > Although I suspect > it would be a pain in the neck to use when cross-compiling. This comment has already been made about write-manager-file in Gabble and Rakia. Perhaps we could have it as a manual step, and just check in the resulting manager files? It's not as if they change very often. If it can be automated (as it can for CMs, but probably not for clients?), the regression tests could sanity-check that it hasn't changed, perhaps? One alternative way to get a manager/client file out, which is just as problematic for cross-compiling but doesn't need D-Bus or Python, would be to have a C API to write it out, and activate it via a command-line option (like dbus-daemon --introspect).
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-glib/issues/58.
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.