Report committed channel creation results through the headless API
This commit is contained in:
1 parent
129fece0af
commit
956febe1d7
1 file changed
+4
-2
@@ -592,8 +592,10 @@ static void hc_handle_connect(struct headless_client* cli, int id, const char* j
|
||||
static void hc_handle_create_channel(struct headless_client* cli, int id, const char* json) {
|
||||
char name[256];
|
||||
if (json_get_str(json, "name", name, sizeof(name)) < 0) { send_response(cli, id, NULL, "missing 'name' param"); return; }
|
||||
chat_core_create_channel_auto(cli->hc->inst, name);
|
||||
send_response(cli, id, "{\"created\":true}", NULL);
|
||||
uint64_t channel = chat_core_create_channel_auto(cli->hc->inst, name);
|
||||
if (!channel) { send_response(cli, id, NULL, "channel creation failed (see log)"); return; }
|
||||
char result[96]; snprintf(result, sizeof(result), "{\"created\":true,\"channel_id\":\"%llu\"}", (unsigned long long)channel);
|
||||
send_response(cli, id, result, NULL);
|
||||
}
|
||||
|
||||
static void hc_handle_invite_to(struct headless_client* cli, int id, const char* json) {
|
||||
|
||||
Reference in new issue
Block a user