Clickable links in MXit

Andrew Victor avictor.za at gmail.com
Wed Nov 25 09:53:36 EST 2009


hi,

The services running on MXit make use of "clickable" links for user-navigation.

For a "news" type of service, the following would be displayed in the
chat window:
News
-------
- News headline 1  [More info...]
- News headline 2 [More info...]
- News headline 3 [More info...]
[Main menu]  [Next page]

When the user clicks on one of the [..] links, a message with a
defined value is sent back to the contact so the next appropriate page
can be displayed.

I am wondering what is the correct way in Pidgin/libpurple to implement this?
So far, I see 3 possible mechanisms.


1) Output an <a href="gopher://..data.."> in the chat-window and
override the PurpleNotifyUiOps.notify_uri method.
If the "data" is not a valid MXit command, call the original notify_uri handler.

This is what we're doing now [see mxit_register_uri_handler() &
mxit_link_click()].
This method seems to work, but occasionally on Windows it causes IE to
launch instead of being handled by Pidgin.
(I guess it depends on which application has last registered the
gopher:// handler in the registry).

We could define a "mxit://" protocol handler in pidgin_utils_init().


2) Output an <a href="mxit:...data..."> in the chat-window and use the
purple-uri-handler script.
I can process the click in the purple-uri-handler script, and call the
goim() which calls purple.PurpleConvSendConfirm().
But that puts the value to send back to the service in the
conversation input window.  So the user has to click and then press
Enter to send - not user-friendly.

The purple-uri-handler also seems to be for non-WIN32 systems only.


3) Use purple_signal_connect() for "uri-handler".
I cannot seem to get my handler function to be called.


What is the best / easiest way to implement something like this?
Are there any other protocol plugins that do something similar?


Regards,
  Andrew Victor




More information about the Devel mailing list