# HG changeset patch # User Ethan Blanton # Date 1070417024 0 # Node ID 1adc71ed6d451aab020f6bba74ddf1e76dc63d4b # Parent 2823111061ba64057330cae7e2c105debb057a3f [gaim-migrate @ 8358] I noticed that this wasn't implemented while I was looking for the reason that kicks don't work properly for IRC with respect to removing the users in a channel ... the answer is simple, but in the process I was debugging with Gaim Commander and noticed this missing functionality. The beauty of Tcl is that it only took a few seconds to add it. (... and don't you all wish you had Gaim Commander?) committer: Tailor Script diff -r 2823111061ba -r 1adc71ed6d45 plugins/tcl/TCL-HOWTO --- a/plugins/tcl/TCL-HOWTO Wed Dec 03 02:03:25 2003 +0000 +++ b/plugins/tcl/TCL-HOWTO Wed Dec 03 02:03:44 2003 +0000 @@ -149,6 +149,7 @@ and chats as described above. gaim::connection account gc +gaim::connection displayname gc gaim::connection handle gaim::connection list @@ -159,6 +160,9 @@ account is the same account used by gaim::account and other commands. + 'displayname' returns the display name (duh) of 'gc' as reported by + gaim_connection_get_display_name(gc). + 'handle' returns the gaim connections instance handle. (See 'gaim::signal connect'). diff -r 2823111061ba -r 1adc71ed6d45 plugins/tcl/tcl_cmds.c --- a/plugins/tcl/tcl_cmds.c Wed Dec 03 02:03:25 2003 +0000 +++ b/plugins/tcl/tcl_cmds.c Wed Dec 03 02:03:44 2003 +0000 @@ -400,8 +400,8 @@ int tcl_cmd_connection(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { Tcl_Obj *result = Tcl_GetObjResult(interp), *list, *elem; - char *cmds[] = { "account", "handle", "list", NULL }; - enum { CMD_CONN_ACCOUNT, CMD_CONN_HANDLE, CMD_CONN_LIST } cmd; + char *cmds[] = { "account", "displayname", "handle", "list", NULL }; + enum { CMD_CONN_ACCOUNT, CMD_CONN_DISPLAYNAME, CMD_CONN_HANDLE, CMD_CONN_LIST } cmd; int error; GList *cur; GaimConnection *gc; @@ -427,6 +427,18 @@ } Tcl_SetIntObj(result, (int)gaim_connection_get_account(gc)); break; + case CMD_CONN_DISPLAYNAME: + if (objc != 3) { + Tcl_WrongNumArgs(interp, 2, objv, "gc"); + return TCL_ERROR; + } + error = Tcl_GetIntFromObj(interp, objv[2], (int *)&gc); + if (error || !tcl_validate_gc(gc)) { + Tcl_SetStringObj(result, "invalid gc", -1); + return TCL_ERROR; + } + Tcl_SetStringObj(result, (char *)gaim_connection_get_display_name(gc), -1); + break; case CMD_CONN_HANDLE: if (objc != 2) { Tcl_WrongNumArgs(interp, 2, objv, "");