about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-03-29 03:16:41 +0100
committerJames Booth <boothj5@gmail.com>2015-03-29 03:16:41 +0100
commit71c2be599b54fb3cf7beb2a0855ad2a9d1bf6a0b (patch)
tree8cd55ad9cc7c804fc0434d8b4488b50e364fefaa /src/command
parent1917d4c095d3df705a79a92078bef060d50b6947 (diff)
downloadprofani-tty-71c2be599b54fb3cf7beb2a0855ad2a9d1bf6a0b.tar.gz
Use password for chat room invites
Diffstat (limited to 'src/command')
-rw-r--r--src/command/commands.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/command/commands.c b/src/command/commands.c
index 76da2a93..2699924b 100644
--- a/src/command/commands.c
+++ b/src/command/commands.c
@@ -2118,10 +2118,15 @@ cmd_join(gchar **args, struct cmd_help_t help)
     options_destroy(options);
 
     // In the case that a nick wasn't provided by the optional args...
-    if (nick == NULL) {
+    if (!nick) {
         nick = account->muc_nick;
     }
 
+    // When no password, check for invite with password
+    if (!passwd) {
+        passwd = muc_invite_password(room);
+    }
+
     if (!muc_active(room)) {
         presence_join_room(room, nick, passwd);
         muc_join(room, nick, passwd, FALSE);