From: Jonathan Rose Date: Fri, 28 Sep 2012 19:21:10 +0000 (+0000) Subject: res_jabber: Remove CLI command 'jabber test' X-Git-Tag: 10.10.0-rc1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9b6d01456b65be78dca7e8edb809b64f3ef39d7;p=thirdparty%2Fasterisk.git res_jabber: Remove CLI command 'jabber test' The opinion of development was that it is both improper to have Matt's personal email address used in the source and that the command wouldn't be useful without it. (closes issue AST-467) Reported by: Malcolm Davenport ........ Merged revisions 374032 from http://svn.asterisk.org/svn/asterisk/branches/1.8 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@374045 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_jabber.c b/res/res_jabber.c index a486fac822..388b40fb1e 100644 --- a/res/res_jabber.c +++ b/res/res_jabber.c @@ -313,7 +313,6 @@ static char *aji_do_set_debug(struct ast_cli_entry *e, int cmd, struct ast_cli_a static char *aji_do_reload(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a); static char *aji_show_clients(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a); static char *aji_show_buddies(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a); -static char *aji_test(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a); static int aji_create_client(char *label, struct ast_variable *var, int debug); static int aji_create_buddy(char *label, struct aji_client *client); static int aji_reload(int reload); @@ -385,7 +384,6 @@ static struct ast_cli_entry aji_cli[] = { AST_CLI_DEFINE(aji_do_reload, "Reload Jabber configuration"), AST_CLI_DEFINE(aji_show_clients, "Show state of clients and components"), AST_CLI_DEFINE(aji_show_buddies, "Show buddy lists of our clients"), - AST_CLI_DEFINE(aji_test, "Shows roster, but is generally used for mog's debugging."), AST_CLI_DEFINE(aji_cli_create_collection, "Creates a PubSub node collection."), AST_CLI_DEFINE(aji_cli_list_pubsub_nodes, "Lists PubSub nodes"), AST_CLI_DEFINE(aji_cli_create_leafnode, "Creates a PubSub leaf node"), @@ -4241,69 +4239,6 @@ static char *aji_show_buddies(struct ast_cli_entry *e, int cmd, struct ast_cli_a return CLI_SUCCESS; } -/*! - * \internal - * \brief Send test message for debugging. - * \return CLI_SUCCESS,CLI_FAILURE. - */ -static char *aji_test(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a) -{ - struct aji_client *client; - struct aji_resource *resource; - const char *name; - struct aji_message *tmp; - - switch (cmd) { - case CLI_INIT: - e->command = "jabber test"; - e->usage = - "Usage: jabber test \n" - " Sends test message for debugging purposes. A specific client\n" - " as configured in jabber.conf must be specified.\n"; - return NULL; - case CLI_GENERATE: - return NULL; - } - - if (a->argc != 3) { - return CLI_SHOWUSAGE; - } - name = a->argv[2]; - - if (!(client = ASTOBJ_CONTAINER_FIND(&clients, name))) { - ast_cli(a->fd, "Unable to find client '%s'!\n", name); - return CLI_FAILURE; - } - - /* XXX Does Matt really want everyone to use his personal address for tests? */ /* XXX yes he does */ - ast_aji_send_chat(client, "mogorman@astjab.org", "blahblah"); - ASTOBJ_CONTAINER_TRAVERSE(&client->buddies, 1, { - ASTOBJ_RDLOCK(iterator); - ast_verbose("User: %s\n", iterator->name); - for (resource = iterator->resources; resource; resource = resource->next) { - ast_verbose("Resource: %s\n", resource->resource); - if (resource->cap) { - ast_verbose(" client: %s\n", resource->cap->parent->node); - ast_verbose(" version: %s\n", resource->cap->version); - ast_verbose(" Jingle Capable: %d\n", resource->cap->jingle); - } - ast_verbose(" Priority: %d\n", resource->priority); - ast_verbose(" Status: %d\n", resource->status); - ast_verbose(" Message: %s\n", S_OR(resource->description, "")); - } - ASTOBJ_UNLOCK(iterator); - }); - ast_verbose("\nOooh a working message stack!\n"); - AST_LIST_LOCK(&client->messages); - AST_LIST_TRAVERSE(&client->messages, tmp, list) { - //ast_verbose(" Message from: %s with id %s @ %s %s\n",tmp->from, S_OR(tmp->id,""), ctime(&tmp->arrived), S_OR(tmp->message, "")); - } - AST_LIST_UNLOCK(&client->messages); - ASTOBJ_UNREF(client, ast_aji_client_destroy); - - return CLI_SUCCESS; -} - /*! * \internal * \brief creates aji_client structure.