Skip to content
This repository has been archived by the owner on Apr 17, 2020. It is now read-only.

alternate_nick to null at connect. #473

Open
irssibot opened this issue Nov 27, 2006 · 2 comments
Open

alternate_nick to null at connect. #473

irssibot opened this issue Nov 27, 2006 · 2 comments

Comments

@irssibot
Copy link
Collaborator

In "irc/core/irc-nicklist.c"
Function: event_nick_in_use

The value server->connrec->alternate_nick is set to NULL when you set the alternate_nick in irssi an saved the changes.

Example:
I have a network configured in chatnets with a nickname and some servers:
hispano = {type ="IRC"; nick ="anick:password";};

When I connect with: irssi -c hispano, if the nick is in use, it doesn't try the alternate_nick. I checked this using a fprintf in the function "event_nick_in_use":

fprintf(stderr,"server->nick = %s\nserver->connrec->nick = %s\nserver->connrec->alternate_nick=%s\n",
server->nick, server->connrec->nick, server->connrec->alternate_nick);
/* nick already in use - need to change it .. */
.....

And I got this:
server->nick = anick:apassword
server->connrec->nick = anick:apassword
server->connrec->alternate_nick=(null)

But in the configuration it's not null:
18:21 [server]
18:21 alternate_nick = rolf2

I'm trying to track down the where that structure is filled, but my knowledge of the source code is limited and I'm going very slow.

Also the behaviour in irssi-svn is the same.

Thank you for your time.

@irssibot
Copy link
Collaborator Author

More information.

I've been tracing the variable through these functions, and the value is lost in function get_server_connect.

[create_addr_conn] conn: 0x1246fe0
[sig_server_setup_fill] conn - 0x1246fe0
[sig_server_setup_fill] alternate_nick = rolf2 (0x1246fd0)
[get_server_connect] conn: 0x1246fe0
[get_server_connect] alternate_nick = "rolf2" (0x1246fd0)
[get_server_connect] alternate_nick = "" (0x1246fd0)
[cmd_connect] conn: 0x1246fe0
[cmd_connect] alternate_nick = "" (0x1246fd0)
[irc_server_init_connect] conn: 0x1246fe0
[irc_server_init_connect] alternate_nick: (null)

Exactly when it returns from cmd_params_free(free_arg); just before returning (at the end).

Now I'm a bit lost in the code. I'll try to give more information.

@irssibot
Copy link
Collaborator Author

(2nd try with this post)

I found the... "problem"?

After cleaning some errors in my debug code (pointers, as always).

File: irc/core/irc-servers-setup.c
Function: sig_server_setup_fill_chatnet
Code:
if (ircnet->nick != NULL) g_free_and_null(conn->alternate_nick);

If you do that... when connecting we don't have an alternate nickname...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

1 participant