about summary refs log tree commit diff stats
path: root/src/command/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/command/command.c')
-rw-r--r--src/command/command.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/command/command.c b/src/command/command.c
index f6918e99..fcb37078 100644
--- a/src/command/command.c
+++ b/src/command/command.c
@@ -86,6 +86,7 @@ static char * _statuses_autocomplete(char *input, int *size);
 static char * _alias_autocomplete(char *input, int *size);
 static char * _join_autocomplete(char *input, int *size);
 static char * _log_autocomplete(char *input, int *size);
+static char * _room_autocomplete(char *input, int *size);
 
 GHashTable *commands = NULL;
 
@@ -303,6 +304,14 @@ static struct cmd_t command_defs[] =
           "Decline invitation to a chat room, the room will no longer be in the list of outstanding invites.",
           NULL } } },
 
+    { "/room",
+        cmd_room, parse_args, 2, 2, NULL,
+        { "/room config accept|cancel", "Room configuration.",
+        { "/room config accept|cncel",
+          "-------------------------",
+          "Accept or cancel room creation.",
+          NULL } } },
+
     { "/rooms",
         cmd_rooms, parse_args, 0, 1, NULL,
         { "/rooms [conference-service]", "List chat rooms.",
@@ -934,6 +943,8 @@ static Autocomplete statuses_setting_ac;
 static Autocomplete alias_ac;
 static Autocomplete aliases_ac;
 static Autocomplete join_property_ac;
+static Autocomplete room_ac;
+static Autocomplete room_config_ac;
 
 /*
  * Initialise command autocompleter and history
@@ -1185,6 +1196,13 @@ cmd_init(void)
     autocomplete_add(alias_ac, "remove");
     autocomplete_add(alias_ac, "list");
 
+    room_ac = autocomplete_new();
+    autocomplete_add(room_ac, "config");
+
+    room_config_ac = autocomplete_new();
+    autocomplete_add(room_config_ac, "accept");
+    autocomplete_add(room_config_ac, "cancel");
+
     cmd_history_init();
 }
 
@@ -1228,6 +1246,8 @@ cmd_uninit(void)
     autocomplete_free(alias_ac);
     autocomplete_free(aliases_ac);
     autocomplete_free(join_property_ac);
+    autocomplete_free(room_ac);
+    autocomplete_free(room_config_ac);
 }
 
 gboolean
@@ -1351,6 +1371,8 @@ cmd_reset_autocomplete()
     autocomplete_reset(alias_ac);
     autocomplete_reset(aliases_ac);
     autocomplete_reset(join_property_ac);
+    autocomplete_reset(room_ac);
+    autocomplete_reset(room_config_ac);
     bookmark_autocomplete_reset();
 }
 
@@ -1629,6 +1651,7 @@ _cmd_complete_parameters(char *input, int *size)
     g_hash_table_insert(ac_funcs, "/statuses",      _statuses_autocomplete);
     g_hash_table_insert(ac_funcs, "/alias",         _alias_autocomplete);
     g_hash_table_insert(ac_funcs, "/join",          _join_autocomplete);
+    g_hash_table_insert(ac_funcs, "/room",          _room_autocomplete);
 
     char parsed[*size+1];
     i = 0;
@@ -2039,6 +2062,24 @@ _theme_autocomplete(char *input, int *size)
 }
 
 static char *
+_room_autocomplete(char *input, int *size)
+{
+    char *result = NULL;
+
+    result = autocomplete_param_with_ac(input, size, "/room config", room_config_ac, TRUE);
+    if (result != NULL) {
+        return result;
+    }
+
+    result = autocomplete_param_with_ac(input, size, "/room", room_ac, TRUE);
+    if (result != NULL) {
+        return result;
+    }
+
+    return NULL;
+}
+
+static char *
 _statuses_autocomplete(char *input, int *size)
 {
     char *result = NULL;
'n267' href='#n267'>267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388