[asterisk-commits] jrose: branch 10 r374045 - in /branches/10: ./ res/res_jabber.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 28 14:21:15 CDT 2012


Author: jrose
Date: Fri Sep 28 14:21:10 2012
New Revision: 374045

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=374045
Log:
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

Modified:
    branches/10/   (props changed)
    branches/10/res/res_jabber.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/res/res_jabber.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/res/res_jabber.c?view=diff&rev=374045&r1=374044&r2=374045
==============================================================================
--- branches/10/res/res_jabber.c (original)
+++ branches/10/res/res_jabber.c Fri Sep 28 14:21:10 2012
@@ -313,7 +313,6 @@
 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 @@
 	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"),
@@ -4238,69 +4236,6 @@
 		});
 		iterator = client;
 	});
-	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 <connection>\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 at 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;
 }
 




More information about the asterisk-commits mailing list