Changing NICK programmatically
Posted: Tue Mar 29, 2005 9:00 pm
I'm looking for some pointers on how to change a NICK from a module.
I'm using the IRC server in a single host environment pretty much for a chat room. When someone logs in (via the HOOK for local pre connection), I look up their user info in a db4 file and authenticate them. Once piece of info in that db4 file is a nick. It is guaranteed to be unique and cannot conflict with others (there are no remote servers involved since I'm running a single host).
I've look around the code and am not sure how to approach this challenge. I'm not running any services and don't think I will.
Can I modify the nick info somehow during the local pre connect hook?
Can I hook some other place like local connect and within the hook call 'm_nick' to change the persons nick upon login to the value in my db4 file?
Is there a way for a hook to 'send a command' as if the user sent it?
For users connecting via an applet on my webpage, I set their nick correctly in the applet param tags before the applet connects. However, I'd like to allow people who want the flexibility of using a standalone IRC client to be supported. For those, I have no control on how they configure their nick in their client so when the login, I want to immediately change their nick based on my db4 file.
Any suggestions on approaches to coding such a thing? Thanks.
I'm using the IRC server in a single host environment pretty much for a chat room. When someone logs in (via the HOOK for local pre connection), I look up their user info in a db4 file and authenticate them. Once piece of info in that db4 file is a nick. It is guaranteed to be unique and cannot conflict with others (there are no remote servers involved since I'm running a single host).
I've look around the code and am not sure how to approach this challenge. I'm not running any services and don't think I will.
Can I modify the nick info somehow during the local pre connect hook?
Can I hook some other place like local connect and within the hook call 'm_nick' to change the persons nick upon login to the value in my db4 file?
Is there a way for a hook to 'send a command' as if the user sent it?
For users connecting via an applet on my webpage, I set their nick correctly in the applet param tags before the applet connects. However, I'd like to allow people who want the flexibility of using a standalone IRC client to be supported. For those, I have no control on how they configure their nick in their client so when the login, I want to immediately change their nick based on my db4 file.
Any suggestions on approaches to coding such a thing? Thanks.