<br><br><div class="gmail_quote">On Sun, Jun 21, 2009 at 7:55 AM, Sjoerd Simons <span dir="ltr">&lt;<a href="mailto:sjoerd.simons@collabora.co.uk">sjoerd.simons@collabora.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Thu, Jun 18, 2009 at 04:14:10PM -0600, Neil Loknath wrote:<br>
&gt; Hey everyone!<br>
&gt;<br>
&gt; My name is Neil (nloko on IRC), and I&#39;m working on the Banshee with<br>
&gt; Telepathy Integration project for SoC [0]. As I understand it, MC5 is coming<br>
&gt; soon. If you&#39;ve seen my blog posts [1], you know that I&#39;ve made some good<br>
&gt; progress on it. Therefore, I will need to make some changes to my project<br>
&gt; when Empathy is ported to MC5. I thought it would be a good idea to get some<br>
&gt; feedback on what I think I will need to change. I&#39;ve already had some<br>
&gt; discussion with wjt on IRC, but more information/confirmation on what I will<br>
&gt; need to do will be very helpful. See below:<br>
&gt;<br>
&gt; 1) Currently, I am using MissionControl.AccountStatusChanged signal to<br>
&gt; detect when connections become active/disconnected.<br>
&gt;     MC5: Use Account.AccountPropertiesChanged [2]<br>
<br>
</div>Correct.<br>
<div class="im"><br>
&gt; 2) Using MissionControl.SetPresence to set presence message (I know Usertune<br>
&gt; would be more appropriate, but since it&#39;s not there, I am making due with<br>
&gt; this)<br>
&gt;     MC5: Use Account.RequestedPresence property [3]??<br>
<br>
</div>... Please don&#39;t do this, it&#39;s very annoying.. But if you really want to then<br>
yes, Account.RequestedPresence is the most appropriate.<br>
<div class="im"><br>
&gt; 3) I&#39;m using the ContactListChannel, Group, and SimplePresence interfaces to<br>
&gt; find contact, track presence, etc.<br>
&gt;     MC5: Assuming that nothing here will have to change<br>
<br>
</div>Correct, the only thing that differs here is how you would get the initial<br>
Connection object, after that you can do all the same things.<br>
<div class="im"><br>
&gt; 4) Using ContactCapabilities.SetSelfCapabilities to advertise my DBusTube<br>
&gt; service. And, using ContactCapabilities.GetCapabilities to find out if other<br>
&gt; contacts support my service.<br>
&gt;     MC5:<br>
&gt; * Register dbus name org.freedesktop.Telepathy.Client.clientname,<br>
&gt;   (where clientname = Banshee ? ), that points to an object implementing<br>
&gt;   org.freedesktop.Telepathy.Client.Handler [4]. Set the HandleChannelFilter<br>
&gt;   property to the channels that are to be handled by Banshee. Banshee will<br>
&gt;   be a non-activatible client, so no .client file.<br>
<br>
</div>Yeah. You register org.freedesktop.Telepathy.Client.Banshee which implements<br>
org.freedesktop.Telepathy.Client and org.freedesktop.Telepathy.Client.Handler<br>
interfaces. The Interfaces property on Telepathy.Client should contain<br>
Client.Handler. And as you say the HandleChannelFilter contains the channels<br>
handled by Banshee<br>
<div class="im"><br>
&gt; * Implement the HandleChannels method to handle my channels (ie.<br>
&gt;   accept/close tube). This makes handling the NewChannels signal of the<br>
&gt;   Requests interface obsolete, correct? In other words, I won&#39;t need it.<br>
<br>
</div>Yes. NewChannels will be handled by MC5 and it&#39;ll call your HandleChannels<br>
method if you are the choosen handler for the channel.<br>
<div class="im"><br>
&gt; * I don&#39;t need to implement Client.Approver [5] as well, do I? It<br>
&gt;   seems redundant to me.<br>
<br>
</div>You don&#39;t have to (and probably shouldn&#39;t) implement an approver indeed<br>
<div class="im"><br>
&gt; * Can ContactCapabilities.GetCapabilities and<br>
&gt;   ContactCapabilitiesChanged signal still be used to discover what services<br>
&gt;   other contacts provide? I use this to filter out contacts that don&#39;t matter<br>
&gt;   to Banshee, since they can&#39;t participate in sharing.<br>
<br>
</div>Yeah, that&#39;ll stay the same<br>
<div class="im"><br>
&gt; 5) I&#39;m using the Requests Interface [6] to create channels and detect new<br>
&gt; ones. On NewChannels signal, I compare SelfHandle to InitiatorHandle to<br>
&gt; determine where the channel is coming from and take the appropriate action.<br>
&gt;     MC5: Should I use org.freedesktop.Telepathy.ChannelDispatcher [7]<br>
&gt; instead? And, pass it my Banshee Client.Handler dbus name?<br>
<br>
</div>Yes, use CreateChannel on the ChannelDispatcher and pass yourself as the<br>
preferred handler for that channel.<br>
<div class="im"><br>
&gt; And, as I have said above, Client.Handler.HandleChannels replaces the need to<br>
&gt; handle the NewChannels signal, right? Or, should I still use the Requests<br>
&gt; interface?<br>
<br>
</div>Nope, as mentioned above, the dispatcher does the job of requesting channels<br>
and demultiplexing incoming channels so you don&#39;t have to use the Requests<br>
interface directly.<br>
<div class="im"><br>
&gt; Long post! But, this information will be very helpful to me, and maybe<br>
&gt; others too. If there is anything else you think I should know, please let me<br>
&gt; know. I hope I have covered everything.<br>
&gt;<br>
&gt; Thanks in advance for your help with my project<br>
<br>
</div>No problem, sorry for taking quite some time to get a response to you :)<br>
</blockquote><div><br>Response time was just fine. No complaints. :)  I appreciate you taking the time to respond.<br><br>Now, I know that I will definitely have to change how I query for active connections, monitor them, presence setting, etc. with MC5. But, it seems to me that using the org.freedesktop.Telepathy.Client, Client.Handler, ChannelDispatcher, etc. interfaces are just a higher level layer above what I am doing now. ie. interacting directly with the CM via the Requests and ContactCapabilities interfaces. <br>
<br>So, what disadvantages are there to sticking with the Requests and ContactCapabilities interfaces instead of using the new MC5 things? <br><br>I know that, since SetSelfCapabilities does a replace operation, I would have to aggregate the existing advertised capabilities by doing a GetContactCapabilities, either adding or removing my tube service (depending on what I want to do at the time), then calling SetSelfCapabilities with the appropriately aggregated/manipulated dictionary passed. However, I think this introduces a race condition where the capabilities could change in between the time that do my Get, and manipulate, Set. That, unfortunately, might become difficult to manage and introduce bugs when a user is running more than one Telepathy service.<br>
<br>But, by sticking with interacting directly with the CM, are there any other disadvantages that I&#39;m overlooking?<br><br>Thanks again,<br>Neil<br><br> <br></div></div><br>