Re: DBUS - Pidgin presence

2011-06-07 Thread Etan Reisner
On Mon, Jun 06, 2011 at 12:42:10PM +0200, Krzysztof wrote:
   { Initializes the errors }
   dbus_error_init(@FDBErr);

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

   { Request the name of the bus }
   ret := dbus_bus_request_name(FDBConn, 'im.pidgin.purple.PurpleInterface',
 DBUS_NAME_FLAG_REPLACE_EXISTING, @FDBErr);

 It works but only if I connect when pidgin is running. If my plugin connect
 first (I don't get any errors) and then run Pidgin, then I don't get any
 signals (receiving and sending chat message).
 How can I check if pidgin is running or connect with correct flags?

request_name isn't the right thing for you to be using there. You want to
connect to signals/etc. on that name not claim to own it yourself. I'm
surprised this works at all actually.

This is likely why you don't get an error since claiming a name that isn't
taken isn't an error causing scenario.

-Etan

___
Support@pidgin.im mailing list
Want to unsubscribe?  Use this link:
http://pidgin.im/cgi-bin/mailman/listinfo/support


Re: DBUS - Pidgin presence

2011-06-07 Thread Krzysztof
Hmm. What should I call then? Free pascal doesn't have dbus bindings yet
(like python) so I must use low level dbus api which I found in free pascal
dbus demo. I am listening for signals in loop in thread.
___
Support@pidgin.im mailing list
Want to unsubscribe?  Use this link:
http://pidgin.im/cgi-bin/mailman/listinfo/support

DBUS - Pidgin presence

2011-06-06 Thread Krzysztof
Hi,

I am using free pascal for listening for pidgin signals. This is my code to
connect:

  { Initializes the errors }
  dbus_error_init(@FDBErr);

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

  { Request the name of the bus }
  ret := dbus_bus_request_name(FDBConn, 'im.pidgin.purple.PurpleInterface',
DBUS_NAME_FLAG_REPLACE_EXISTING, @FDBErr);

It works but only if I connect when pidgin is running. If my plugin connect
first (I don't get any errors) and then run Pidgin, then I don't get any
signals (receiving and sending chat message).
How can I check if pidgin is running or connect with correct flags?

Regards
___
Support@pidgin.im mailing list
Want to unsubscribe?  Use this link:
http://pidgin.im/cgi-bin/mailman/listinfo/support