[Psi-devel] URI handler for the n-th time
Maciek Niedzielski
machekku at uaznia.net
Wed Nov 15 17:41:26 PST 2006
Yes, it's me writing about URI handler again ;)
I saw some people on Psi chatroom excited about D-Bus, etc, so I decided
to share my not finished URI handler code. I am a bit busy recently, so
I don't think I can finish it in the near future. However, I think it
may be useful if someone wants to write the handler, etc.
The idea behind this code is:
1. Psi instances are addressed by profile names
2. All communication for all kind of handlers (mainly URI handler) is a
consequence of running psi with some commandline arguments, so all the
data needed to be passed to other instance may be represented as a list
of strings (QStringList).
3. Communication should be as easy as possible, so it can be easily
ported to any platform.
There is Windows implementation based on WM_COPYDATA.
ActiveProfiles class is used to:
1. Check if given profile is running.
2. Register instance with profile name (so it can receive messages from
other instances).
3. Send/receive string lists.
ActivePsiProfiles class is a subclass designed for Psi. It has
additional sendOpenUri() to ask other instance to open given URI and
openUri() signal. They work by sending ("openUri", uri) string list
between instances. Any other needed command can be implemented this way.
Command line options:
--uri= to pass the URI (with "xmpp:" at the beginning)
--profile= used to say which profile should handle this URI.
Note: Since there is no command line parser in Psi and these arguments
cannot be easily stored and used later, all this works *only* if there
already is a running instance to handle the request.
Someone could reuse IceRAM's parser, or write another one to improve here.
XMPP URI:
Implemented query types: message, roster, join, vcard, disco. There are
some more in the XEP.
Attachments:
1. Patch
2. Windows registry file to register the handler (please correct the
path to your psi.exe).
Have fun :)
--
Maciek
xmpp:machekku at uaznia.net
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: psi-machekku-partial_uri_handler.patch
Url: http://lists.affinix.com/pipermail/psi-devel-affinix.com/attachments/20061116/b111aaa4/psi-machekku-partial_uri_handler-0001.ksh
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: win_uri.reg
Url: http://lists.affinix.com/pipermail/psi-devel-affinix.com/attachments/20061116/b111aaa4/win_uri-0001.ksh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 257 bytes
Desc: OpenPGP digital signature
Url : http://lists.affinix.com/pipermail/psi-devel-affinix.com/attachments/20061116/b111aaa4/signature-0001.pgp
More information about the psi-devel
mailing list