about summary refs log tree commit diff stats
path: root/src/command.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-07-18 00:19:51 +0100
committerJames Booth <boothj5@gmail.com>2012-07-18 00:19:51 +0100
commit61600cb7b689cf0d66f697e2ac8be3c7f2ce00b4 (patch)
treeacd27825435797fadf3cf52b1f20906326c0907c /src/command.c
parenteb4f2241733ccdd79e1c270d0244ba29296776b4 (diff)
downloadprofani-tty-61600cb7b689cf0d66f697e2ac8be3c7f2ce00b4.tar.gz
Set usernames to lowercase before logging in
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/command.c b/src/command.c
index 7d03a476..05122a96 100644
--- a/src/command.c
+++ b/src/command.c
@@ -159,8 +159,10 @@ static gboolean _cmd_connect(const char * const inp)
         cons_show("Usage: /connect user@host");
         result = TRUE;
     } else {
-        char *user;
+        char *user, *lower;
         user = strndup(inp+9, strlen(inp)-9);
+        lower = g_utf8_strdown(user, -1);
+
         status_bar_get_password();
         status_bar_refresh();
         char passwd[21];
@@ -168,7 +170,7 @@ static gboolean _cmd_connect(const char * const inp)
         inp_get_password(passwd);
         inp_non_block();
         
-        conn_status = jabber_connect(user, passwd);
+        conn_status = jabber_connect(lower, passwd);
         if (conn_status == JABBER_CONNECTING)
             cons_show("Connecting...");
         if (conn_status == JABBER_DISCONNECTED)