Improve the AltNick handling
Improve the AltNick handling

Thanks to ViciousPotato for reporting that AltNicks were truncated to 9
characters.

We assumed the server's maximum nick length to be 9 by default which made the
code truncate the AltNick to 9 characters.

Now we save the nick we sent last to the IRC server. If the server reports a
"nick is already in use" with a nick shorter than we sent it, we assume this
that the server truncated our nick to the allowed length and use this length for
our retries (appending different characters to the default nick).

Not all irc servers truncate the nick this way if it's too long, on those that
don't this patch shouldn't cause any behavior change.


git-svn-id: 3ad904ec35b89a071badd9cb0113dfe58093e920@1620 726aef4b-f618-498e-8847-2d620e286838

jpnurmi/znc,KiNgMaR/znc,GLolol/znc,Adam-/znc,Hasimir/znc,reedloden/znc,Phansa/znc,Mkaysi/znc,KielBNC/znc,Mkaysi/znc,GLolol/znc,Adam-/znc,jpnurmi/znc,YourBNC/znc,wolfy1339/znc,wolfy1339/znc,YourBNC/znc,jantman/znc,dgw/znc,Phansa/znc,DarthGandalf/znc,TuffLuck/znc,wolfy1339/znc,TuffLuck/znc,KiNgMaR/znc,badloop/znc,elyscape/znc,DarthGandalf/znc,GLolol/znc,BtbN/znc,kashike/znc,Mkaysi/znc,znc/znc,withinsoft/znc,Zarthus/znc,trisk/znc,TuffLuck/znc,KiNgMaR/znc,jpnurmi/znc,Zarthus/znc,TingPing/znc,kashike/znc,BtbN/znc,Mkaysi/znc,Mikaela/znc,markusj/znc,anthonyryan1/znc,kashike/znc,jreese/znc,DarthGandalf/znc,Adam-/znc,TingPing/znc,withinsoft/znc,YourBNC/znc,psychon/znc,jantman/znc,GLolol/znc,YourBNC/znc,kashike/znc,DarthGandalf/znc,Adam-/znc,jantman/znc,trisk/znc,KielBNC/znc,withinsoft/znc,Phansa/znc,KielBNC/znc,Hasimir/znc,jpnurmi/znc,Phansa/znc,Kriechi/nobnc,KiNgMaR/znc,evilnet/znc,anthonyryan1/znc,Mkaysi/znc,anthonyryan1/znc,Mikaela/znc,aarondunlap/znc,anthonyryan1/znc,ollie27/znc,Kriechi/nobnc,psychon/znc,DarthGandalf/znc,badloop/znc,ollie27/znc,dgw/znc,trisk/znc,wolfy1339/znc,Kriechi/znc,YourBNC/znc,elyscape/znc,aarondunlap/znc,Kriechi/znc,aarondunlap/znc,Kriechi/znc,jpnurmi/znc,Adam-/znc,aarondunlap/znc,badloop/znc,GLolol/znc,Zarthus/znc,Zarthus/znc,znc/znc,ollie27/znc,TuffLuck/znc,jreese/znc,elyscape/znc,anthonyryan1/znc,dgw/znc,dgw/znc,znc/znc,withinsoft/znc,BtbN/znc,jantman/znc,kashike/znc,KiNgMaR/znc,elyscape/znc,TingPing/znc,DarthGandalf/znc,reedloden/znc,KielBNC/znc,BtbN/znc,GLolol/znc,Kriechi/znc,Kriechi/znc,Mikaela/znc,trisk/znc,Zarthus/znc,Adam-/znc,badloop/znc,jreese/znc,Adam-/znc,Kriechi/znc,znc/znc,aarondunlap/znc,withinsoft/znc,TingPing/znc,ollie27/znc,jantman/znc,trisk/znc,jreese/znc,evilnet/znc,aarondunlap/znc,Phansa/znc,evilnet/znc,psychon/znc,anthonyryan1/znc,jreese/znc,ollie27/znc,Mikaela/znc,psychon/znc,BtbN/znc,TingPing/znc,Mkaysi/znc,Mkaysi/znc,evilnet/znc,markusj/znc,znc/znc,badloop/znc,Hasimir/znc,TuffLuck/znc,KiNgMaR/znc,aarondunlap/znc,anthonyryan1/znc,evilnet/znc,withinsoft/znc,Mikaela/znc,ollie27/znc,jreese/znc,markusj/znc,jpnurmi/znc,markusj/znc,Kriechi/nobnc,znc/znc,jpnurmi/znc,psychon/znc,Zarthus/znc,badloop/znc,Hasimir/znc,badloop/znc,dgw/znc,TingPing/znc,TuffLuck/znc,KielBNC/znc,reedloden/znc,KielBNC/znc,evilnet/znc,TuffLuck/znc,wolfy1339/znc,Mikaela/znc,wolfy1339/znc,Phansa/znc,Hasimir/znc,trisk/znc,Hasimir/znc,reedloden/znc,Mikaela/znc,dgw/znc,BtbN/znc,markusj/znc,Hasimir/znc,psychon/znc,jantman/znc,reedloden/znc,markusj/znc,YourBNC/znc,elyscape/znc,reedloden/znc,elyscape/znc,kashike/znc