[Telepathy] Proposed MC api

Xavier Claessens xclaesse at gmail.com
Mon May 28 13:33:34 PDT 2007


On lun, 2007-05-28 at 13:35 +0300, Naba Kumar wrote:
> Hi,
> 
> Proposed MC API:
> 

Here is an extension for channel filtering. Filters are useful to avoid
poping chat/voip/etc windows directly to the user. For example when a
new Text channel is created I want to show a libnotify bubble with the
first message and make empathy's status icon blink, wait for the user to
click on it, and then dispatch the channel. It can also be used to add
some rules to ignore chat from black-listed contacts, etc...

Filter:
-------

* RegisterFilter(s:chan_type, u: filter_flag, u: priority) -> object

Tells MC that new channels of type chan_type shouldn't be dispatched
directly. A new filter object is created on the bus and returned. If the
dbus name of the caller vanishs we can remove the filter just like if
Close() was called on it.

FilterObject:
-------------

* Dispatch (u: serial, b: dispatch)

Tells MC to dispatch or not the channel represented by the serial.

* GetPendingChannels () -> a{s: bus_name, o: connection, s:
channel_type, o: channel, u: handle_type, u: handle, u:serial}

Get all channels that are waiting for filtering. Of course only channels
of the type used for registering the filter can be returned here.

* Close()

Unregister the filter and remove the object from the bus. Pending
channels are dispatched.

* signal NewChannel(s: bus_name, o: connection, s: channel_type, o:
channel, u: handle_type, u: handle, u:serial)

There is a new channel waiting for filtering. It won't be dispatched
before Dispatch() is called with the serial. Of course only channels of
the type used for registering the filter can be returned here.



Comments are welcome !


More information about the Telepathy mailing list