# HG changeset patch # User Ethan Blanton # Date 1062653769 0 # Node ID 05098da416bbb33e2ea5d148411709938bd255f8 # Parent e411a7d6378cc260a7564a2fe551c21a3903b718 [gaim-migrate @ 7269] hum dee dum, this isn't the command you're looking for committer: Tailor Script diff -r e411a7d6378c -r 05098da416bb plugins/tcl/tcl_cmds.c --- 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");