mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-26 12:16:21 +00:00
Use domain part of current jid when no jid passed to /disco
This commit is contained in:
@@ -350,7 +350,7 @@ static struct cmd_t main_commands[] =
|
|||||||
NULL } } },
|
NULL } } },
|
||||||
|
|
||||||
{ "/disco",
|
{ "/disco",
|
||||||
_cmd_disco, parse_args, 2, 2,
|
_cmd_disco, parse_args, 1, 2,
|
||||||
{ "/disco command entity", "Service discovery.",
|
{ "/disco command entity", "Service discovery.",
|
||||||
{ "/disco command entity",
|
{ "/disco command entity",
|
||||||
"---------------------",
|
"---------------------",
|
||||||
@@ -2111,7 +2111,8 @@ _cmd_rooms(gchar **args, struct cmd_help_t help)
|
|||||||
if (args[0] == NULL) {
|
if (args[0] == NULL) {
|
||||||
Jid *jid = jid_create(jabber_get_jid());
|
Jid *jid = jid_create(jabber_get_jid());
|
||||||
GString *conference_node = g_string_new("conference.");
|
GString *conference_node = g_string_new("conference.");
|
||||||
g_string_append(conference_node, jid->domainpart);
|
g_string_append(conference_node, strdup(jid->domainpart));
|
||||||
|
jid_destroy(jid);
|
||||||
iq_room_list_request(conference_node->str);
|
iq_room_list_request(conference_node->str);
|
||||||
g_string_free(conference_node, TRUE);
|
g_string_free(conference_node, TRUE);
|
||||||
} else {
|
} else {
|
||||||
@@ -2131,12 +2132,23 @@ _cmd_disco(gchar **args, struct cmd_help_t help)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_strcmp0(args[0], "info") == 0) {
|
GString *jid = g_string_new("");
|
||||||
iq_disco_info_request(args[1]);
|
if (args[1] != NULL) {
|
||||||
|
jid = g_string_append(jid, args[1]);
|
||||||
} else {
|
} else {
|
||||||
iq_disco_items_request(args[1]);
|
Jid *jidp = jid_create(jabber_get_jid());
|
||||||
|
jid = g_string_append(jid, strdup(jidp->domainpart));
|
||||||
|
jid_destroy(jidp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (g_strcmp0(args[0], "info") == 0) {
|
||||||
|
iq_disco_info_request(jid->str);
|
||||||
|
} else {
|
||||||
|
iq_disco_items_request(jid->str);
|
||||||
|
}
|
||||||
|
|
||||||
|
g_string_free(jid, TRUE);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user