diff options
author | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2017-11-01 15:48:35 +0100 |
---|---|---|
committer | ailin-nemui <ailin-nemui@users.noreply.github.com> | 2017-11-01 15:51:20 +0100 |
commit | b0fa4dd46d8bf1cf63880fabf2105dd9134100df (patch) | |
tree | 4541934244408dd231c37e042a7211e531dad275 /src/irc/core/irc-servers-setup.c | |
parent | 7e619ed990503faf45fc1ae1e28a3a6062dc7532 (diff) | |
download | irssi-b0fa4dd46d8bf1cf63880fabf2105dd9134100df.zip |
show initial nick and name on first start
Diffstat (limited to 'src/irc/core/irc-servers-setup.c')
-rw-r--r-- | src/irc/core/irc-servers-setup.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/irc/core/irc-servers-setup.c b/src/irc/core/irc-servers-setup.c index bae7d3b4..22c86f57 100644 --- a/src/irc/core/irc-servers-setup.c +++ b/src/irc/core/irc-servers-setup.c @@ -116,14 +116,17 @@ static void sig_server_setup_fill_chatnet(IRC_SERVER_CONNECT_REC *conn, static void init_userinfo(void) { + int changed; const char *set, *nick, *user_name, *str; + changed = 0; /* check if nick/username/realname wasn't read from setup.. */ set = settings_get_str("real_name"); if (set == NULL || *set == '\0') { str = g_getenv("IRCNAME"); settings_set_str("real_name", str != NULL ? str : g_get_real_name()); + changed |= 1<<0; } /* username */ @@ -134,6 +137,7 @@ static void init_userinfo(void) str != NULL ? str : g_get_user_name()); user_name = settings_get_str("user_name"); + changed |= 1<<1; } /* nick */ @@ -143,15 +147,20 @@ static void init_userinfo(void) settings_set_str("nick", str != NULL ? str : user_name); nick = settings_get_str("nick"); + changed |= 1<<2; } /* host name */ set = settings_get_str("hostname"); if (set == NULL || *set == '\0') { str = g_getenv("IRCHOST"); - if (str != NULL) + if (str != NULL) { settings_set_str("hostname", str); + changed |= 1<<3; + } } + + signal_emit("irssi init userinfo changed", 1, GINT_TO_POINTER(changed)); } static void sig_server_setup_read(IRC_SERVER_SETUP_REC *rec, CONFIG_NODE *node) |