diff options
author | Philip Flohr <philip.flohr@hadiko.de> | 2019-02-22 11:07:19 +0100 |
---|---|---|
committer | Philip Flohr <philip.flohr@hadiko.de> | 2019-02-22 13:08:08 +0100 |
commit | 5b7f9dffbc62a3af2e9663f32c34d27adee319b3 (patch) | |
tree | e4b8a94a3679ad9c74f2dfbe10612f0a8e89eb18 /src/command/cmd_funcs.c | |
parent | 6034b833be41909982b0d2bdac0a1d8499ad8e76 (diff) | |
download | profani-tty-5b7f9dffbc62a3af2e9663f32c34d27adee319b3.tar.gz |
Fix broken support for case-sensitive account names
Don't lower account name before calling accounts_get_account(). Only lower if there is no account with the given name and the name is interpreted as a jid. Updated unittests to test this behaviour. Fixes #725 .
Diffstat (limited to 'src/command/cmd_funcs.c')
-rw-r--r-- | src/command/cmd_funcs.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c index 6cdd40fb..d280e6c8 100644 --- a/src/command/cmd_funcs.c +++ b/src/command/cmd_funcs.c @@ -386,12 +386,11 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args) } } - char *lower = g_utf8_strdown(user, -1); char *jid; g_free(def); // connect with account - ProfAccount *account = accounts_get_account(lower); + ProfAccount *account = accounts_get_account(user); if (account) { // override account options with connect options if (altdomain != NULL) @@ -414,7 +413,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args) account->password = NULL; } else { cons_show("Error evaluating password, see logs for details."); - g_free(lower); + g_free(user); account_free(account); return TRUE; } @@ -432,7 +431,7 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args) // connect with JID } else { - jid = strdup(lower); + jid = g_utf8_strdown(user, -1); char *passwd = ui_ask_password(); conn_status = cl_ev_connect_jid(jid, passwd, altdomain, port, tls_policy); free(passwd); @@ -444,7 +443,6 @@ cmd_connect(ProfWin *window, const char *const command, gchar **args) } options_destroy(options); - g_free(lower); free(jid); return TRUE; |