1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Removed /room info command, covered by /info

This commit is contained in:
James Booth 2014-10-11 23:37:04 +01:00
parent 8b77f527c0
commit c66d03539d
3 changed files with 8 additions and 10 deletions

View File

@ -1,4 +1,5 @@
Reorganise/simplify room commands Reorganise/simplify room commands
Add /room affiliation|role list with no arg to show all
Fix room commands help Fix room commands help
Show role/affiliation on join Show role/affiliation on join
Show role/affiliation on update Show role/affiliation on update

View File

@ -1291,7 +1291,6 @@ cmd_init(void)
autocomplete_add(room_ac, "accept"); autocomplete_add(room_ac, "accept");
autocomplete_add(room_ac, "destroy"); autocomplete_add(room_ac, "destroy");
autocomplete_add(room_ac, "config"); autocomplete_add(room_ac, "config");
autocomplete_add(room_ac, "info");
autocomplete_add(room_ac, "role"); autocomplete_add(room_ac, "role");
autocomplete_add(room_ac, "affiliation"); autocomplete_add(room_ac, "affiliation");

View File

@ -1501,6 +1501,7 @@ cmd_info(gchar **args, struct cmd_help_t help)
win_type_t win_type = ui_current_win_type(); win_type_t win_type = ui_current_win_type();
PContact pcontact = NULL; PContact pcontact = NULL;
Occupant *occupant = NULL; Occupant *occupant = NULL;
char *room = NULL;
if (conn_status != JABBER_CONNECTED) { if (conn_status != JABBER_CONNECTED) {
cons_show("You are not currently connected."); cons_show("You are not currently connected.");
@ -1510,6 +1511,7 @@ cmd_info(gchar **args, struct cmd_help_t help)
switch (win_type) switch (win_type)
{ {
case WIN_MUC: case WIN_MUC:
room = ui_current_recipient();
if (usr) { if (usr) {
char *room = ui_current_recipient(); char *room = ui_current_recipient();
occupant = muc_roster_item(room, usr); occupant = muc_roster_item(room, usr);
@ -1519,7 +1521,10 @@ cmd_info(gchar **args, struct cmd_help_t help)
ui_current_print_line("No such occupant \"%s\" in room.", usr); ui_current_print_line("No such occupant \"%s\" in room.", usr);
} }
} else { } else {
ui_current_print_line("You must specify a nickname."); ProfWin *window = wins_get_by_recipient(room);
iq_room_info_request(room);
ui_show_room_info(window, room);
return TRUE;
} }
break; break;
case WIN_CHAT: case WIN_CHAT:
@ -2237,8 +2242,7 @@ cmd_room(gchar **args, struct cmd_help_t help)
(g_strcmp0(args[0], "destroy") != 0) && (g_strcmp0(args[0], "destroy") != 0) &&
(g_strcmp0(args[0], "config") != 0) && (g_strcmp0(args[0], "config") != 0) &&
(g_strcmp0(args[0], "role") != 0) && (g_strcmp0(args[0], "role") != 0) &&
(g_strcmp0(args[0], "affiliation") != 0) && (g_strcmp0(args[0], "affiliation") != 0)) {
(g_strcmp0(args[0], "info") != 0)) {
cons_show("Usage: %s", help.usage); cons_show("Usage: %s", help.usage);
return TRUE; return TRUE;
} }
@ -2252,12 +2256,6 @@ cmd_room(gchar **args, struct cmd_help_t help)
ui_index = 0; ui_index = 0;
} }
if (g_strcmp0(args[0], "info") == 0) {
iq_room_info_request(room);
ui_show_room_info(window, room);
return TRUE;
}
if (g_strcmp0(args[0], "affiliation") == 0) { if (g_strcmp0(args[0], "affiliation") == 0) {
char *cmd = args[1]; char *cmd = args[1];
if (cmd == NULL) { if (cmd == NULL) {