Created
December 27, 2012 03:10
-
-
Save mathematicalcoffee/4385143 to your computer and use it in GitHub Desktop.
doing chat from gnome 3.6 gnome shell extension.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On 19/12/12 07:46, Stefano Ciancio wrote: | |
> is possible to launch an empathy chat window from an extension in gnome 3.6? | |
Yes, request a Telepathy text channel (and make Empathy be the preferred | |
Handler, if you want). | |
examples/client/python/ensure-channel.py in the telepathy-glib source | |
tree is something similar, but in Python. The important bits are that it: | |
* gets an Account object from the AccountManager (in a Shell extension | |
you'd presumably already have an Account you want to use - or you can | |
list all accounts that exist by their DisplayName and let the user | |
choose) | |
* creates an AccountChannelRequest | |
(in recent Telepathy this can be made simpler by creating it with | |
AccountChannelRequest.new_text(), then calling | |
set_target_contact() or set_target_id() on it) | |
* calls ensure_channel_async() | |
If you specifically want Empathy (and not some other Telepathy UI, like | |
kde-telepathy or Shell), you can pass | |
org.freedesktop.Telepathy.Client.Empathy.Chat as the preferred_handler | |
parameter to ensure_channel_async(). | |
If you *really* want the chat to end up in Empathy, even if another | |
client like Shell itself is already dealing with a chat with that | |
contact, also call set_delegate_to_preferred_handler() on the | |
AccountChannelRequest. | |
S |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment