mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-19 11:06:21 +00:00
Fix tests, move glob creation
This commit is contained in:
@@ -4393,8 +4393,8 @@ cmd_rooms(ProfWin *window, const char *const command, gchar **args)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
char *service = NULL;
|
||||
char *match = NULL;
|
||||
gchar *service = NULL;
|
||||
gchar *filter = NULL;
|
||||
if (args[0] != NULL) {
|
||||
if (g_strcmp0(args[0], "service") == 0) {
|
||||
if (args[1] == NULL) {
|
||||
@@ -4403,13 +4403,13 @@ cmd_rooms(ProfWin *window, const char *const command, gchar **args)
|
||||
return TRUE;
|
||||
}
|
||||
service = g_strdup(args[1]);
|
||||
} else if (g_strcmp0(args[0], "match") == 0) {
|
||||
} else if (g_strcmp0(args[0], "filter") == 0) {
|
||||
if (args[1] == NULL) {
|
||||
cons_bad_cmd_usage(command);
|
||||
cons_show("");
|
||||
return TRUE;
|
||||
}
|
||||
match = g_strdup(args[1]);
|
||||
filter = g_strdup(args[1]);
|
||||
} else {
|
||||
cons_bad_cmd_usage(command);
|
||||
cons_show("");
|
||||
@@ -4422,21 +4422,21 @@ cmd_rooms(ProfWin *window, const char *const command, gchar **args)
|
||||
cons_bad_cmd_usage(command);
|
||||
cons_show("");
|
||||
g_free(service);
|
||||
g_free(match);
|
||||
g_free(filter);
|
||||
return TRUE;
|
||||
}
|
||||
g_free(service);
|
||||
service = g_strdup(args[3]);
|
||||
} else if (g_strcmp0(args[2], "match") == 0) {
|
||||
} else if (g_strcmp0(args[2], "filter") == 0) {
|
||||
if (args[3] == NULL) {
|
||||
cons_bad_cmd_usage(command);
|
||||
cons_show("");
|
||||
g_free(service);
|
||||
g_free(match);
|
||||
g_free(filter);
|
||||
return TRUE;
|
||||
}
|
||||
g_free(match);
|
||||
match = g_strdup(args[3]);
|
||||
g_free(filter);
|
||||
filter = g_strdup(args[3]);
|
||||
} else {
|
||||
cons_bad_cmd_usage(command);
|
||||
cons_show("");
|
||||
@@ -4444,12 +4444,6 @@ cmd_rooms(ProfWin *window, const char *const command, gchar **args)
|
||||
}
|
||||
}
|
||||
|
||||
GPatternSpec *glob = NULL;
|
||||
if (match != NULL) {
|
||||
glob = g_pattern_spec_new(match);
|
||||
g_free(match);
|
||||
}
|
||||
|
||||
if (service == NULL) {
|
||||
ProfAccount *account = accounts_get_account(session_get_account_name());
|
||||
if (account->muc_service) {
|
||||
@@ -4459,12 +4453,12 @@ cmd_rooms(ProfWin *window, const char *const command, gchar **args)
|
||||
cons_show("Account MUC service property not found.");
|
||||
account_free(account);
|
||||
g_free(service);
|
||||
g_free(match);
|
||||
g_free(filter);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
iq_room_list_request(service, glob);
|
||||
iq_room_list_request(service, filter);
|
||||
|
||||
g_free(service);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user