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

Hib Eris Hib at hiberis.nl
Sun Jan 25 17:08:02 EST 2009


Hi,

I am trying to fix a bug in Gnumeric and I think it might originate in
purple-url-handler, so I would like to ask you for help and your opinions on
how to fix it.

Here is the problem:

I am wroking on a basic Ubuntu installation with Pidgin and Gnumeric
installed. I started Gnumeric from the Applications (=start) menu in Gnome.
In Gnumeric,
I select the help menu, and than 'Live Assistance'. This should open an irc
session on irc://irc.gnome.org/#gnumeric. Unfortunately this only works when

Pidgin is already running. If Pidgin is not running, nothing happens. No
graphical error message.

This is what I found out:

- When I run gnumeric from a console I get the error message: Error: no
libpurple-powered client is running. Try starting Pidgin or Finch.

- Now where did this come from:
   * gnumeric calls g_info_app_launch_default_for_uri (a function from
glib/gio) with irc://irc.gnome.org/#gnumeric as an argument.
   * g_info_app_launch_default_for_uri looks up the default handler for irc.
When Pidgin is installed on Ubuntu and running in Gnome, this is
purple-url-handler.
   * g_info_app_launch_default_for_uri starts purple-url-handler and returns
success when purple-url-handler starts.
   * on success, gnumeric is happy and does not report any error.
   * purple-url-handler runs and looks for a running libpurple-powered
client. If it cannot find one, it prints an error message on the console and
exits.

I think there are 2 problems with this:

 1. The g_info_app_launch_default_for_uri cannot detect errors in a helper
application after the helper launched successfully. Therefore any errors
should be dealt with
      in an appropriate manner by the helper application. In this case a GUI
application (gnumeric) running in the Gnome desktop environment launches
      purple-url-helper, so it would be appropriate to handle any errors in
a GUI instead of reporting them on the console. A fix requires a change in
the error
      handling of purple-url-helper to use gtk.

      Is such a change acceptable? This change would effectively change
purple-url-helper from a console application to a GUI application. A problem
with this
      might be that some console based applications expect purple-url-helper
to work without GTK. Are there any applications like this (I don't know)?
      If there are, a solution for this can be to create two separate
url-helpers, one using gtk and one not using it. Then, it is upto
      g_info_app_launch_default_for_uri to decided which one it should use.
Running in Gnome, it can select the gtk one by specifying this in
      /usr/share/gconf/schemas/purple.schemas.

     So, two possible solutions:

             1.  Change purple-url-handler to a GTK application.
             2.  Create a new purple-gtk-url-handler.

 2. When I call purple-url-handler, I expect it to launch a program to
handle the given url. I do not expect it to fail because the program that is
supposed to handle it
     has not yet started before I call the handler.

     Now, from http://developer.pidgin.im/ticket/149, I understand that it
was decided to not start pidgin automatically from purple-url-handler
because
     'the possibly unwanted reaction of pidgin running when it was not
simply via clicking on a url' . In my opinion, this is not a valid argument.
I think it should
     be left to the program calling the url handler to decide if it wants to
start pidgin. If it does not want to start pidgin it should not call the
handler. If it decides
     to call the handler it wants pidgin to be started. If it is unwanted to
run pidgin by clicking on an url, then this should be fixed in the program
in which the url is clicked.

     Well, that is my opinion, obviously motivated by a desire to fix the
bug I described. I would like to hear your opinions.

     To automatically start pidgin from purple-url-handler, all that is
required is a .service file (see http://developer.pidgin.im/ticket/149).
Alternatively, when purple-url-handler
     is changed to a gtk application, it could interact with the user and
ask for confirmation before starting pidgin.

     So, again two possible solutions:

            1. Start pigdin automatically from purple-url-handler.
            2. Let purple-url-handler start pidgin after interaction with
the user.

Please let me know which solutions you prefer. I prefer the number 1.
solutions, as they are easier to implement and do 'the right thing' in my
opnion. The number 2.
solutions however cause less change to the current behaviour of
purple-url-handler.

If you want me to, I will create patches for a preferred solution.

Thank you for your attention,

Hib Eris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://pidgin.im/pipermail/devel/attachments/20090125/7142b9e7/attachment-0001.html>


More information about the Devel mailing list