libpurple and imprudence
kevin at simguy.net
Wed Mar 30 19:50:56 EDT 2011
On Wed, 30 Mar 2011 16:24:31 -0700, chris-tuchs at hushmail.com wrote:
> Thanks for your replies Christopher and Kevin!
> So, I found the source to 2.7.11, built it, ran it, been reading
> code. No obvious doc "here's how you replace Pidgin and Finch
> with your favorite gui and IM system stuff", not that I expected
> it. It seems like a pretty rare usecase to me. Though if you
> have even some half baked docs, I would love to read them.
> Replacing the Pidgin and Finch UIs is half of what I'm going to
> be doing.
Take a look at the nullclient.c shipped with our source. This is a
very lightweight client that implements a UI for libpurple without doing
much complex magic. Particularly, you'll be looking to run your own
main loop, call libpurple's initialization functions for the
functionality you need, and implement and register a function for each
uiop you have need to present to the user (or handle silently).
> The earlier work I did integrating a client directly with libotr
> was aided by libotr's fairly small interface spec. A list of
> about 6 functions to define the 'ui' for libotr, and a few
> functions to call into it to get it to do stuff. Is there a
> similar list of the UI focused services that libpurple need to
> become a IM client?
As above, you basically register your UI functions by setting up uiops
for each section of libpurple's API and those callbacks will provide the
information necessary to present the result to the user or act on it.
Sometimes you might need to register signal handlers instead for certain
interactions, but it's mostly uiops.
> The other half of what I am looking at doing is providing a new
> IM back end type plugin. (Or maybe two, the client source base
> is not beautiful.) I am expecting to need to provide services
> like connect, send message, get message, test buddy presence,
> etc. Is that documented anywhere? It is not obvious on the
You might want to look at one of the simpler prpls in
libpurple/protocols/ to get an idea how this works. You fill out a
struct basically with callback functions which libpurple will use when
the associated UI is accessed. You will write necessary protocol and
network code and deal with notifying libpurple when a new message or
other server-generated activity comes in. libpurple will then take care
of notifying whichever UI of the activity via the uiops.
> I understand I don't need source to dependencies like
> libgpg-error, I was just stumbling around with no hint of what
> version of pidgin (I guess you can't get just libpurple) I
We do not distribute libpurple separately, though most distributions do
separate the binary package out, so you can ultimately depend on the
libpurple available in the distribution to be there if you like without
require pidgin to be installed.
> Would it be reasonable and permitted for us (developers working
> on imprudence) to ship libpurple with the client (imprudence)?
> Would that cause users of Pidgin/Finch/libpurple any issues?
This is completely fine as long as distribution is in compliance with
the GPL. For example, you must release your source and you must release
any changes to make to libpurple.
More information about the Devel