translate_uri
This small tool was made to help Jabber clients handle legacy networks' URIs. However, it was written in a way that may probably be used for some other purposes ;)
Problem description
Imagine that you'd like to use your Jabber client to send emails (yes, this is possible if you're using SMTP transport). You'd like mailto links (mailto:me@example.org) to be handled by your Jabber client. However, your Jabber client doesn't understand mailto:. However, it would work if you translated mailto: link into xmpp: one this way: xmpp:me%example.org@mail.example.com. The problem is: How to translate this automatically?
Solution
translate_uri was created to translate URIs. translate_uri -u mailto:me@example.org -t A@B -e xmpp:__A__%__B__@mail.example.com will solve our problem.
Usage
To make translate_uri work, you need to supply three arguments:translate_uri -u [uri] -t [uritype] -e [execute]
- uri
- source uri, eg. 'mailto:me@example.org'
- uritype
- one of: 'A', 'A@B', determines how to interpret the uri
- execute
- new uri to invoke, eg. 'xmpp:__A__%__B__@mail.example.com'
How to make it really work
Ok, everything sounds nice, but how does this tool really help? To get real benefits from it, you have to register it as legacy network's URI handler. How?
Let's continue our mailto example:
Open Registry Editor, find (or create) key 'HKEY_CLASSES_ROOT\mailto'. Under this key, create new empty string value named 'URL Protocol'. Then you need a subkey 'shell\open\command' with default value 'C:\path\to\translate_uri -u %1 -t A@B -e xmpp:__A__%__B__@mail.example.com'.
License
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.