From 7e4f439ccaf898edee560fd7351b7dabdc14ae3a Mon Sep 17 00:00:00 2001 From: Marius Halden Date: Tue, 26 Jul 2016 19:44:18 +0200 Subject: Do not try to list chatrooms if account is offline --- root_commands.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'root_commands.c') 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; -- cgit v1.2.3