Action Links

Ralf Kistner ralfgm at gmail.com
Sat Dec 1 12:42:08 EST 2007


On Friday 30 November 2007, Kevin Stange wrote:
> Ralf Kistner wrote:
> > On Friday 30 November 2007, Kevin Stange wrote:
> >> Ralf Kistner wrote:
> >>> On Friday 30 November 2007, Andreas Monitzer wrote:
> >>>> On Nov 30, 2007, at 15:18, Ralf Kistner wrote:
> >>>>
> >>>>> For the protocol plugin I'm developing, there are bots that send a  
> >>>>> list of
> >>>>> commands to the user. I want the user to be able to click on the  
> >>>>> commands,
> >>>>> which will perform a protocol action. Is this possible at all?
> >>>> The XMPP/Jabber plugin has support for this feature under the name "ad- 
> >>>> hoc commands". I added this to libpurple on SoC 2007. You might get  
> >>>> some hints there on one way to implement this.
> >>>>
> >>>> andy
> >>>>
> >>>>
> >>> Thanks for the info.
> >>>
> >>> Although the idea of the commands are similar, I want it to be implemented 
> > in 
> >>> a different way. The user needs to be able to click on the commands inside 
> >>> the conversation window, similar to http links.
> >>>
> >>> Example conversation with a bot:
> >>>
> >>> Tradepost: What can we supply u with today?
> >>> 1) Tradepost Treasure
> >>> 2) Videos
> >>> 3) Games
> >>> 4) Companions
> >>>
> >>> User: 3
> >>>
> >>> Tradepost: Games
> >>> 1) The Battle
> >>> 2) Trivit
> >>> b) Back
> >>>
> >>> User: 2
> >>>
> >>> etc.
> >>>
> >>>
> >>> I want the user to be able to click on the text (like a link), instead of 
> >>> typing in the number of the command.
> >>>
> >>> Is this possible?
> >>>
> >> This isn't necessarily always going to work (depending on your client's
> >> capabilities), but if you have your URL handlers enabled with
> >> purple-uri-handler (or a client's equivalent), you could use links like
> >>
> >> aim:goim?screename=<user> ....
> >>
> >> There are similar URIs for XMPP, etc.
> >>
> >>
> > 
> > 
> > Thanks, this seems like what I want.
> > 
> > Is there a way to do this without going through an external browser, or is 
> > this done inside gtk? In other words, when a user clicks on a link (inside a 
> > conversation) with the mxit protocol 
> > (eg "mxit:messsage?user=bot at mxit.co.za&message=command"), I want my protocol 
> > to handle the url instead of the browser.
> > 
> > I tried:
> > 
> > static void mxitprpl_uri_handler_cb(const char* proto, const char* cmd, 
> > GHashTable *params) {
> > 	purple_debug_info("mxitprpl", "uri_handler: %s, %s\n", proto, cmd);
> > }
> > 
> > 
> > purple_signal_connect_priority(purple_get_core(), "uri-handler", plugin, 
> > PURPLE_CALLBACK(mxitprpl_uri_handler_cb), NULL, 
> > PURPLE_SIGNAL_PRIORITY_LOWEST);
> > 
> > but the function is never called.
> 
> You need to configure your desktop environment to recognize the specific
> URI protocol name to run the purple-uri-handler utility.  Once the
> necessary association is configured, it will launch that, rather than a
> browser, to load the protocol.
> 
> Kevin
> 
> 

Is it possible to bypass this so that it doesn't use any external desktop environment or browser?

I only want to do this for links that are clicked on inside Pidgin (I want to intercept the call so that it never goes outside of Pidgin).

Ralf




More information about the Devel mailing list