# URI protocol for invoking pidgin

Daniel Atallah datallah at pidgin.im
Fri Aug 31 10:52:36 EDT 2012

On Thu, Aug 30, 2012 at 9:27 PM, Steven Gauna <smcgauna at gmail.com> wrote:
> Hmm, I am seeing something different than you Mohamed.
>
> I've opened up Firebug's javascript console in Firefox and entered the
> command:
>
>> window.location='xmpp:user.name at oracle.com?message;body=SR 12345';
>
> I opened up Pidgin's debug log and saw the following:
> (18:07:43) winpidgin: Got protocol handler request:
> xmpp:user.name at oracle.com?message;body=SR%2012345
> (18:07:43) util: Processing message
> 'user.name at oracle.com?message;body=SR%2012345' for protocol 'xmpp' using
> delimiter ';'.
>
> What I saw in my conversation window was exactly:
> SR%2012345
>
> In the documentation on
> http://xmpp.org/extensions/xep-0147.html#actions-message, it seems to say
> that the %20 should be translated to a space, but that is not what I am
> seeing.  Using latest version of pidgin on Windows with the following
> protocol handler:
> "C:\Program Files (x86)\Pidgin\pidgin.exe" --protocolhandler=%1
>
> Running the following command:
> C:\Program Files (x86)\Pidgin>pidgin
> --protocolhandler=xmpp:user.name at oracle.com?message;body=SR%2012345
>
> Results in the same behavior.  However, running:
> C:\Program Files (x86)\Pidgin>pidgin
> --protocolhandler=xmpp:user.name at oracle.com?message;body=SR 12345
>
> Results in the behavior Mohamed Hamed is reporting.  This seems to be due to
> the fact that Windows has no proper way of escaping spaces in a parameter.
> So 12345 is passed as %2 which is ignored by Pidgin.  Even trying ^ and \
> problem here is that Pidgin does not seem to be decoding the body parameter
> as expected.  At least not for me.
>
> Anyone else getting different results?

I can recreate this; it seems libpurple should be unescaping the
parameter, but that doesn't seem to be happening.
I guess the thing to do is to file a ticket - if it has a good patch
attached to it, I'll be happy to commit it. :)

The one part that isn't entirely clear to me is whether this should be
done for all protocols or just XMPP - I'm guessing it probably should
be done for everything.

-D