libpurple + dbus - pidgin

Mark Doliner mark at kingant.net
Wed Apr 16 01:43:06 EDT 2008


On Mon, 14 Apr 2008 16:11:31 -0700, Anil Gupta wrote
> > It might help to think of libpurple as the core of an instant messaging
> > program rather than as a library with functions that you call.  The
> > programs
> > "main" method is a part of the ui (either Pidgin or Finch), but libpurple
> > is
> > responsible for saving your preferences and accounts and what not.  It is
> > not
> > possible to use libpurple standalone because there is no "main" method in
> > libpurple.
> >
> > So you would need to at least write a "ui" to bootstrap the libpurple
> > process.
> >  See libpurple/example/nullclient.c for a very basic example.
> 
> ## I looked at nullclient.c but it does not have anything to do with dbus.
> Does dbus initialization happen inside libpurple somewhere or does 
> it happen in the ui clients?

Sorry, I was just giving nullclient.c as an example of a very basic program
that uses libpurple.  It doesn't explicitly use dbus.

dbus initialization happens inside libpurple, in the purple_core_init() function.

> > But using Java
> > and dbus to write the user interface code for libpurple seems awkward to
> > me.
> > Why not just use C?
> 
> ## We do not have UI. UI is all client based on mobile phones. We support
> palm, bb, brew, nokia, java,  ppc, windows ce etc. but  some omf the
> libpurple components would be used.

By "UI" I mean the code you write that interacts with libpurple.  If I
understand correctly you have a small application that runs on a mobile phone
which the user interacts with.  This application talks to your servers running
Java, and your Java code interfaces with libpurple using dbus?

Using Java+dbus for the server side portion seems awkward to me.  Granted I'm
not a big fan of Java, I'm a huge fan of C, and I've never really used
libpurple's dbus capabilities so I don't know how easy or how hard it will be.

> > > c) How scalable in pidgin? We have over 15k users who would like to get
> > > connected. We do not mind scaling by adding boxes but does pidgin
> > support
> > > scaling vertically? Any tips on this would be appreciated.
> > >
> > > d) I hear that pidgin is a single thread approach for the main. What
> > > happens if the thread dies? Is there a recovery mechanism? Any
> > > scripts to restart pidgin to the previous state if it disconnects
> > > with be handy.
> >
> > Hmm, why would the thread die?  That seems akin to a single-threaded
> > process
> > crashing (ie something that should not happen).  No, there is no recovery
> > mechanism short of restarting Pidgin and reconnecting.  Pidgin should
> > connect
> > automatically when you start it, and accounts should return to their
> > previous
> > state (assuming Pidgin is able to write the previous state to
> > $HOME/.purple/*.xml)
> >
> 
> ## Does the libpurple store any account profile? I believe no.

Yes, libpurple stores account info in $HOME/.purple/accounts.xml.  You can
"disable" that by specifying a config directory of /dev/null, but I'm not
convinced that's a very clean solution.  You could also modify libpurple to
not write those configuration files.

> ## BTW, is there any job forum where we can hire a developer to do this for 
> us as we are totally new with dbus and libpurple both. Though its a 
> week work, we would like someone knowledgeable to do the things 
> right the first time rather than keep trying for the correct solution.

No forum specifically for job postings, no.  But most active developers of
libpurple are on this mailing list.  I don't want to speak for everyone, but
in general I think we're ok with the occasional job posting.  It's hard to
complain when people want to pay you money for doing something you like to do
:-)   (Although I know a lot of us are fairly busy so I can't guarantee you'll
get a response.)

-Mark




More information about the Devel mailing list