I modified MC spec with my proposed Chandler system. You can see it there:<br><a href="http://projects.collabora.co.uk/~xclaesse/mc/doc.html">http://projects.collabora.co.uk/~xclaesse/mc/doc.html</a><br>I modified .chandler file format and
org.freedesktop.Telepathy.MissionControl.ChannelHandler interface.<br><br>Xavier Claessens<br><br><div><span class="gmail_quote">2007/10/9, Xavier Claessens <<a href="mailto:xclaesse@gmail.com">xclaesse@gmail.com</a>>:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello,<br><br>I discussed a bit with Guillaume about Tube integration in MC/Empathy<br>
while he was working on gtetrinet to use Empathy. I think we need more<br>powerful chandler/filter system in MC.<br><br>Uses cases:<br>----------<br>1) private chat client want to be started for and receive a Text channel
<br>with an handle of type Contact and muc client wants Text channels with<br>handle type Room.<br>2) Logger application wants to receive any text channel (private and<br>muc), it wants to keep using the channel and let MC start the chat
<br>client.<br>3) StatusIcon and ContactList wants to receive any Text channel *before*<br>the chat client and will tell MC when chat client can be started, like<br>that the they can blink the icon and wait for the user to click on it
<br>before starting the chat program. StatusIcon and ContactList can be<br>separate processes, they both need to get the channel at the same time<br>(before chat client) and once one of them says it's ok to start the chat
<br>the other should be warned to stop blinking.<br>4) GTetrinet wants to receive Tubes channels and TubeID ONLY if the<br>tube's service is "tetrinet-x".<br><br>Problems I see with Nokia's MC:<br>------------------------------
<br> - I can't register a chandler for a given handler+channel type. Makes<br>uses case 1 impossible.<br> - Use case 2 is possible with a filter but the logger process needs to<br>be started before to register the filter and if MC exits because we go
<br>offline the filter needs to be registered again once MC restarts (How<br>logger can know that?).<br> - Use case 3 is not possible. We can register 2 filters but they won't<br>get the channel at the same time, one will be started before the other
<br>and will wait until the user click on the icon and then MC will start<br>the second and wait again for the user to click on it. MC should start<br>all filters with the same priority at the same time and wait until one
<br>of them says the channel can be dispatched, and MC should tell other<br>filters that it's being dispatched so they can stop blink the icon.<br> - Use case 4 is not possible because we can't register a chandler for a
<br>given tube service.<br><br> I know that NMC has a plugin system that should solve most of those<br>problems, but I don't like the idea of writing MC plugins. Chandlers<br>should work with any MC implementation and a bad written chandler
<br>shouldn't be able to make MC crash so it shouldn't be linked into MC's<br>daemon.<br><br>Ideas to solve that:<br>-------------------<br> A I already said for the MC spec standardisation I think we shouldn't
<br>separate the chandler and filter concepts, in the end both are programs<br>that needs to be started when a channel is created. I'll give some ideas<br>for a chandler system that do also filter's job. Chandler programs need
<br>to install a .chandler file containing:<br> - The DBus service of the the chandler program to be started by MC.<br> - The channel type the chandler wants and/or the handle type.<br> - Optionally the tube service (only if the channel type is Tubes). If
<br>it's omitted and the channel type is Tubes MC will start the service for<br>all Tubes channels but not for each new TubeID created on that channel.<br> - A priority number. If at some point more than one chandler should be
<br>started, they get started in the order of priority. Each time MC waits<br>for the chandler to tell it's ok to dispatch before starting chandlers<br>with lower priority. If a chandler says it's not OK to dispatch, MC
<br>Closes the channel and don't start other chandlers. In case of equality<br>MC starts all equal chandlers and waits until one of them says it's ok<br>to dispatch, it tells others started chandlers that the channel is being
<br>dispatched and start the next chandler with lower priority. If the<br>lowest priority chandler (in most cases that's the chat-ui) tells to<br>dispatch and there is no remaining chandlers, MC closes the channel.<br>
<br> So programs that wants to handle a channel have to provide a .chandler<br>file, a .service file for DBus and once it gets started it must register<br>a DBus object providing a standardised interface. This interface needs:
<br> - A "HandleChannel" method that MC will call to give the TpChan and<br>TpConn objects that needs to be handled, a dictionary with some<br>additional information for example if it's a tube chandler we'll have
<br>("service", "tetrinet-x") and ("TubeId", 12) pairs, and a unique<br>ChandlerID number.<br> - A "Process" method that MC will call to tell the chandler the channel<br>has been dispatched to a lower priority chandler (for use case 3). This
<br>method has in parameters the same ChandlerID than the one given in<br>HandleChannel.<br> - A "Dispatch" signal that the chandler will emit when it's OK to<br>dispatch. It as in parameters the ChandlerID given in HandleChannel. If
<br>it's the StatusIcon chandler and the user says he don't want to accept<br>the chat, the chandler Closes the channel and don't emit the signal, MC<br>should listen to "Closed" signal on channels being dispatched and remove
<br>them it they get closed.<br><br>Comments are welcome, I think we can discuss that and include it in MC's<br>standardised spec. I would be really happy if it could be implemented in<br>Nokia's MC.<br><br>Thanks,
<br>Xavier Claessens.<br><br></blockquote></div><br>