If this is being caused by a script on your system, you can quickly get rid of it by typing /remote off
I recommend that you do that before connecting to any networks.
Then connect to the network. If the problem doesn't show up, then it's probably a script, in which case you'll have to go through the scripts that you have loaded, one by one, until you locate the script (or possibly scripts) that is/are causing the problem.
If the problem does still continue, even with your remotes turned off, then it sounds to me like someone is monitoring for when you connect to the network, either via a server notice (which is normally only available to IRCops), or using the Notify list.
You might be able to get around that by logging in to the network using a different nick.
Worst case scenario, relay the network information and we can try ourselves and see what happens.