HookTypes for raw incoming and outgoing messages

These are old archives. They are kept for historic purposes only.
Post Reply
Peiter
Posts: 2
Joined: Thu Nov 04, 2004 11:07 pm
Contact:

HookTypes for raw incoming and outgoing messages

Post by Peiter »

Hi,
it would be really useful to me if there was a HookType that would allow a module to catch an incoming command (single line) and read and/or modify it before it's being sent to the parse() method (this would probably go somewhere into dopaket()).
The same would be useful for outgoing messages. A module could catch an outgoing message just before it's sent to the client (in sendbufto_one() I guess) and read and/or change it accordingly.

You would probably wanna know what I need that for. I was wondering if I could write some sort of a wrapper module that would allow clients that implement a different protocol (e.g. XML-based protocol) to connect to the IRC server by translating incoming messages into IRC before they are parsed by the server, and translating back into the target protocol before they are sent back to the client.
Xuefer
Posts: 20
Joined: Wed Apr 14, 2004 4:30 am

Post by Xuefer »

the problem is, there're many case:
1.a. before parse
1.b. after parse
2.a. before sprintf
2.b. after sprintf

which 2 should we hook? i know what u need, but how about others? and other implement?

performance issue?
callback faster than hook by avoiding a loop?

i'm not one of devel :-)

xml via http, right? http is complete different from irc, except: they both use tcp.
irc use LINES, while http only Header use LINES but with Body use Binary(no \r\n at the end)
is your module open or closed source? i'm very interested in it.
Peiter
Posts: 2
Joined: Thu Nov 04, 2004 11:07 pm
Contact:

Post by Peiter »

So if you want to write a wrapper that implement a completely different protocol, the needed solution would be 1a and 2b.
What I actually wanted to do is, link a Flash IRC client directly to the IRC server, which appearently (I really don't know anything about Flash) is not possible because the only sockets you can open with Flash are XMLSockets that can only sent and receive XML messages.
Solutions I saw so far use a proxy (mostly PHP or Perl) to translate the protocols, but that is very bad for performance and all users on the net would have the same source IP (the one of the server the PHP script is running on) which makes TKLs pretty useless.
Adding this feature is acutally not such a big deal, but it's again one more hack in the core code which makes updating versions even a little more painful than it already is.
Post Reply