aboutsummaryrefslogtreecommitdiffstats
path: root/root_commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'root_commands.c')
-rw-r--r--root_commands.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/root_commands.c b/root_commands.c
index 59974026..a62d6c19 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -1250,6 +1250,11 @@ static void cmd_chat(irc_t *irc, char **cmd)
}
if (cmd[3][0] == '!') {
+ if (!acc->prpl->chat_list) {
+ irc_rootmsg(irc, "Listing chatrooms not supported on that account.");
+ return;
+ }
+
i = g_ascii_strtoull(cmd[3] + 1, NULL, 10);
ci = g_slist_nth_data(acc->ic->chatlist, i - 1);
@@ -1301,7 +1306,7 @@ static void cmd_chat(irc_t *irc, char **cmd)
irc_rootmsg(irc, "Invalid account");
return;
} else if (!acc->prpl->chat_list) {
- irc_rootmsg(irc, "Existing chatrooms not supported on that account.");
+ irc_rootmsg(irc, "Listing chatrooms not supported on that account.");
return;
}
@@ -1338,7 +1343,6 @@ void cmd_chat_list_finish(struct im_connection *ic)
bee_chat_info_t *ci;
char *hformat, *iformat, *topic;
GSList *l;
- GString *userc;
guint i = 0;
irc_t *irc = ic->bee->ui_data;
@@ -1348,31 +1352,22 @@ void cmd_chat_list_finish(struct im_connection *ic)
}
if (strchr(irc->umode, 'b') != NULL) {
- hformat = "%s\t%s\t%s\t%s";
- iformat = "%u\t%s\t%s\t%s";
+ hformat = "%s\t%s\t%s";
+ iformat = "%u\t%s\t%s";
} else {
- hformat = "%s %-20s %s %s";
- iformat = "%5u %-20.20s %5s %s";
+ hformat = "%s %-20s %s";
+ iformat = "%5u %-20.20s %s";
}
- irc_rootmsg(irc, hformat, "Index", "Title", "Users", "Topic");
- userc = g_string_new(NULL);
+ irc_rootmsg(irc, hformat, "Index", "Title", "Topic");
for (l = ic->chatlist; l; l = l->next) {
ci = l->data;
topic = ci->topic ? ci->topic : "";
-
- if (ci->userc >= 0) {
- g_string_printf(userc, "%d", ci->userc);
- } else {
- g_string_assign(userc, "-");
- }
-
- irc_rootmsg(irc, iformat, ++i, ci->title, userc->str, topic);
+ irc_rootmsg(irc, iformat, ++i, ci->title, topic);
}
irc_rootmsg(irc, "%u %s chatrooms", i, acc->tag);
- g_string_free(userc, TRUE);
}
static void cmd_group(irc_t *irc, char **cmd)