Fwd: Shouldn't purple-url-handler start pidgin if it is not running?

Hib Eris Hib at hiberis.nl
Mon Jan 26 11:12:52 EST 2009

Apparently, I forgot to send this reply to the mailing list, so here I
forward it.
Sorry for any inconvenience.

---------- Forwarded message ----------
From: Hib Eris <Hib at hiberis.nl>
Date: Mon, Jan 26, 2009 at 1:20 PM
Subject: Re: Shouldn't purple-url-handler start pidgin if it is not running?
To: Richard Laager <rlaager at wiktel.com>

On Mon, Jan 26, 2009 at 3:34 AM, Richard Laager <rlaager at wiktel.com> wrote:

> On Sun, 2009-01-25 at 23:08 +0100, Hib Eris wrote:
> > If it decides to call the handler it wants pidgin to be started.
> First, I don't think applications should be making any decisions about
> such things. If the user clicks the URL, they should call the
> appropriate function to deal with it. Second, if you step back from the
> problem at hand and go back to your description of what happens, you'll
> see that Gnumeric doesn't even know that this will open Pidgin. It
> doesn't even necessarily care about the type of the URL at all. In
> Pidgin (under GNOME), for example, we linkify all URLs with schemes
> listed in GConf and fire gnome-open on them when clicked. We don't know
> anything about what is going to actually happen to handle them.

I agree with you that applications should not make decisions on _how_
URL's are handled. I meant to say that it is up to the application to decide
_if_ an URL is handled. If an application decides so, it can make the URL
clickable. When the URL is clicked, the application should request the
system/desktop environment to handle the URL. This request is made
trough *g_app_info_launch_default_for_uri*.

What I wanted to make clear is that it is important for the application that

a successful call to g_app_info_launch_default_for_uri is guarantied to
handle the URL appropriately.
In GNOME, purple-url-handler is used to handle irc:// URL's. As I see it,
for two reasons the current purple-url-handler is not optimal for this task:

1. purple-url-handler is a console application that sends error messages
to the console. In GNOME these messages should go to a GUI.

2. purple-url-handler 'refuses' to handle irc:// URL's when pidgin/finch
is not running.

To fix point 2, I suggested to autostart pidgin from purple-url-handler.
Richard  pointed out two problems with this:

There are two problems with autostarting a libpurple client. The one
> previously stated is that starting up Pidgin can result in, for example,
> ten accounts being signed on to open one chat room. A possible solution
> to this would be to make the Exec line in the .service file pass -n to
> avoid signing on any accounts. Then, purple-url-handler would check to
> see that the appropriate account was signed on, connecting it if need
> be, before calling (in this case) serv_join_chat().

Okay, so I understand now a problem is not with autostarting per se, but
with automatically signing in to all accounts. If this is the only objection

to autostarting, the solution to pass '-n'  to pidgin seems right to me.
Checking, signing in and connecting should probably not be done
by purple-url-handler, but by pidgin itself (see below).

The second problem is... which libpurple client do you sign on? Do you
> start up Pidgin, or Finch? If Finch, you're going to have to start it
> under some sort of X terminal for it to work.

I think that selecting which client to use should be done by the desktop
environment/operating system (i.c. GNOME). I may have more IRC clients
then just pidgin and finch. In my desktop settings I would like to make a
selection from for example 1. pidgin, 2. finch or 3. xchat. If my desktop
settings would give me only the options 1. purple-url-handler and 2. xchat
and when I chose purple, it will use pidgin or finch depending on some
other settings somewhere else, it would be very confusing.
So I guess, it would be best to have separate url-handlers for pidgin and
finch and have it specified in the gnome/gconf settings which one to use.

Now,  two separate url handlers sounds like code duplication. Luckily,
there appears to be a plan to replace purple-url-handler:

All that said, I believe that Daniel was talking about wanting to
> replace purple-url-handler with something that just called our internal
> URL handling code (which I think we have somewhere for parsing URLs on
> Windows?). If that were done, you could avoid the account-sign-on
> modification to purple-url-handler (making it in internal code, if
> necessary) and also do something to handle the case of not having an IRC
> account for that server. Ideally, I'd like to see some prompt asking if
> one should be added.

Well, this makes me wonder, do we need purple-url-handler at all? Couldn't
we just use:

> pidgin -n --url 'irc://irc.gnome.org/#pidgin'
> finch -n --url 'irc://irc.gnome.org/#pidgin'

to handle url's? Thus, allowing to set the irc url handler in GNOME to
'pidgin -n --url %s'.
This would also fix my first point why purple-url-handler is not optimal for
because it is a console application, as pidgin has a GUI.

Does this make sense?

Hib Eris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20090126/b2a61328/attachment.html>

More information about the Devel mailing list