diff options
author | Marius Halden <marius.h@lden.org> | 2016-07-26 19:44:18 +0200 |
---|---|---|
committer | jgeboski <jgeboski@gmail.com> | 2016-09-19 20:39:05 -0700 |
commit | 7e4f439ccaf898edee560fd7351b7dabdc14ae3a (patch) | |
tree | de05dc70de0892a9bb6fbb06292ba3bebd3b09ac /root_commands.c | |
parent | 725f94253511a0633d94d615f9c28dd6c8da71f9 (diff) |
Do not try to list chatrooms if account is offline
Diffstat (limited to 'root_commands.c')
-rw-r--r-- | root_commands.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/root_commands.c b/root_commands.c index 2d88b3d6..e0bf2e8f 100644 --- a/root_commands.c +++ b/root_commands.c @@ -1233,7 +1233,10 @@ static void cmd_chat(irc_t *irc, char **cmd) } if (cmd[3][0] == '!') { - if (!acc->prpl->chat_list) { + if (!acc->ic || !(acc->ic->flags & OPT_LOGGED_IN)) { + irc_rootmsg(irc, "Not logged in to account."); + return; + } else if (!acc->prpl->chat_list) { irc_rootmsg(irc, "Listing chatrooms not supported on that account."); return; } @@ -1288,6 +1291,9 @@ static void cmd_chat(irc_t *irc, char **cmd) if (!(acc = account_get(irc->b, cmd[2]))) { irc_rootmsg(irc, "Invalid account"); return; + } else if (!acc->ic || !(acc->ic->flags & OPT_LOGGED_IN)) { + irc_rootmsg(irc, "Not logged in to account."); + return; } else if (!acc->prpl->chat_list) { irc_rootmsg(irc, "Listing chatrooms not supported on that account."); return; |