changeset 6737:05098da416bb

[gaim-migrate @ 7269] hum dee dum, this isn't the command you're looking for committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Thu, 04 Sep 2003 05:36:09 +0000
parents e411a7d6378c
children 6c95f01aaf49
files plugins/tcl/tcl_cmds.c
diffstat 1 files changed, 17 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/tcl/tcl_cmds.c	Thu Sep 04 04:30:22 2003 +0000
+++ b/plugins/tcl/tcl_cmds.c	Thu Sep 04 05:36:09 2003 +0000
@@ -76,16 +76,16 @@
 int tcl_cmd_account(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
 {
 	Tcl_Obj *result = Tcl_GetObjResult(interp), *list, *elem;
-	char *cmds[] = { "alias", "connect", "connection", "disconnect", "find", 
-			 "handle", "isconnected", "list", "protocol", "username",
-			 NULL };
+	char *cmds[] = { "alias", "connect", "connection", "disconnect", "find",
+			 "handle", "isconnected", "list", "public_ip",
+			 "protocol", "username", NULL };
 	enum { CMD_ACCOUNT_ALIAS, CMD_ACCOUNT_CONNECT, CMD_ACCOUNT_CONNECTION,
 	       CMD_ACCOUNT_DISCONNECT, CMD_ACCOUNT_FIND, CMD_ACCOUNT_HANDLE,
-	       CMD_ACCOUNT_ISCONNECTED, CMD_ACCOUNT_LIST, CMD_ACCOUNT_PROTOCOL,
-	       CMD_ACCOUNT_USERNAME } cmd;
+	       CMD_ACCOUNT_ISCONNECTED, CMD_ACCOUNT_LIST, CMD_ACCOUNT_PUBLIC_IP,
+	       CMD_ACCOUNT_PROTOCOL, CMD_ACCOUNT_USERNAME } cmd;
 	char *listopts[] = { "-all", "-online", NULL };
 	enum { CMD_ACCOUNTLIST_ALL, CMD_ACCOUNTLIST_ONLINE } listopt;
-	const char *alias;
+	const char *alias, *ip;
 	GList *cur;
 	GaimAccount *account;
 	int error;
@@ -188,6 +188,17 @@
 		}
 		Tcl_SetObjResult(interp, list);
 		break;
+	case CMD_ACCOUNT_PUBLIC_IP:
+		if (objc != 3) {
+			Tcl_WrongNumArgs(interp, 2, objv, "account");
+			return TCL_ERROR;
+		}
+		error = Tcl_GetIntFromObj(interp, objv[2], (int *)&account);
+		if (error || !tcl_validate_account(account, interp))
+			return TCL_ERROR;
+		ip = gaim_account_get_public_ip(account);
+		Tcl_SetStringObj(result, ip != NULL ? (char *)ip : "", -1);
+		break;
 	case CMD_ACCOUNT_PROTOCOL:
 		if (objc != 3) {
 			Tcl_WrongNumArgs(interp, 2, objv, "account");