I replaced the attachment above with a new version, implemented the following changes:
- Fixed ColorToPlus for RGB values, Plus! wants 3 digits per value
- Messenger interface is passed in the Messenger property of the plugin now as IDispatch, so you're responsible for checking it's assigned and supports the IMessenger interface...
- Added support for filters. Explanation below.
Filters
I've seen several people struggling with the fact that Plus! plugins can't output tags like (!IP). Well, they can, but Plus! won't parse 'em so you just get (!IP) in the message instead of the actual IP address. Although this may change in future versions of Plus!, I added filters to the framework to solve it until then. A filter is basically a function which needs to be registered, and gets called whenever the plugin generates output (tags, commands, notifications). These filters may do whatever they like to the output, in the case of the supplied filters I'm using it to emulate the Plus! tags such as (!IP), (!N) and (!FCx). As far as I know all but three tags are supported: (!CN), (!VER) and (!WAT). WAT can be added quite easily, CN hasn't been added because I noticed Patchou scrambled the contact's email addresses (which is good for preventing abuse of course, but bad for me, now I can't read the custom names
).
The filters included have been split into various units. The way they're designed all you have to do to include the filter is add it to your project, they will register themselves. This makes it easy to exclude tags you don't need...
Because the Pos() function in Delphi is quite limited and StringReplace() is slow, I've used
FastStrings for the filters. When you are not using the filters, it's not required to get FastStrings. If you do, FastStrings is easy to install, just dump the files in a directory and make sure that directory is in your library path (Tools -> Environment Options -> Library).
The demo project has also been updated with a /xtags command to show the use of filters.