[Telepathy] Simple example for listening signals

Krzysztof dibo20 at wp.pl
Wed Jun 8 12:34:22 PDT 2011


Hi,

I am writting chat history manager. I need listen for incoming and outgoing
text messages (from empathy). I have done similar plugin for pidgin IM using
dbus too. So I am trying now create this same thing for empathy. I spent all
day looking at the telepathy documentation and got a headache :) . I'm
writting in Free Pascal. It doesn't have special bindings so I am using dbus
low level api. I know that text channel is what I'm looking for, but there
is so much interfaces and I am lost. All python examples using bindings and
I can't see what is going in background. This is my code for listening
signals in pidgin:

  { Initializes the errors }
  dbus_error_init(@FDBErr);

  { Connection }
  FDBConn := dbus_bus_get(DBUS_BUS_SESSION, @FDBErr);

  if FDBConn = nil then Exit;

  dbus_bus_add_match(FDBConn,
'type=''signal'',interface=''im.pidgin.purple.PurpleInterface''', @FDBErr);
  dbus_connection_flush(FDBConn);

and in loop I just check:

  if (dbus_message_is_signal(msg, 'im.pidgin.purple.PurpleInterface',
'ReceivedImMsg')<>0) then
  ........

What should I do to get this same thing on telepathy?

Regards and sorry for my English
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/telepathy/attachments/20110608/2f75030e/attachment.html>


More information about the telepathy mailing list