changeset 14295:b76462fea543

[gaim-migrate @ 16985] I was working on debugging something and these came in handy. committer: Tailor Script <tailor@pidgin.im>
author Etan Reisner <pidgin@unreliablesource.net>
date Tue, 22 Aug 2006 19:18:46 +0000
parents 8a6154a52b84
children 8342b39f975b
files libgaim/plugins/tcl/tcl_cmds.c
diffstat 1 files changed, 22 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libgaim/plugins/tcl/tcl_cmds.c	Tue Aug 22 18:28:00 2006 +0000
+++ b/libgaim/plugins/tcl/tcl_cmds.c	Tue Aug 22 19:18:46 2006 +0000
@@ -670,8 +670,8 @@
 int tcl_cmd_conversation(ClientData unused, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
 {
 	Tcl_Obj *list, *elem, *result = Tcl_GetObjResult(interp);
-	const char *cmds[] = { "find", "handle", "list", "new", "write", NULL };
-	enum { CMD_CONV_FIND, CMD_CONV_HANDLE, CMD_CONV_LIST, CMD_CONV_NEW, CMD_CONV_WRITE } cmd;
+	const char *cmds[] = { "find", "handle", "list", "new", "write", "name", "title", NULL };
+	enum { CMD_CONV_FIND, CMD_CONV_HANDLE, CMD_CONV_LIST, CMD_CONV_NEW, CMD_CONV_WRITE , CMD_CONV_NAME, CMD_CONV_TITLE } cmd;
 	const char *styles[] = { "send", "recv", "system", NULL };
 	enum { CMD_CONV_WRITE_SEND, CMD_CONV_WRITE_RECV, CMD_CONV_WRITE_SYSTEM } style;
 	const char *newopts[] = { "-chat", "-im" };
@@ -783,6 +783,26 @@
 		else
 			gaim_conv_im_write(GAIM_CONV_IM(convo), from, what, flags, time(NULL));
 		break;
+	case CMD_CONV_NAME:
+		if (objc != 3) {
+			Tcl_WrongNumArgs(interp, 2, objv, "conversation");
+			return TCL_ERROR;
+		}
+
+		if ((convo = tcl_validate_conversation(objv[2], interp)) == NULL)
+			return TCL_ERROR;
+		Tcl_SetStringObj(result, (char *)gaim_conversation_get_name(convo), -1);
+		break;
+	case CMD_CONV_TITLE:
+		if (objc != 3) {
+			Tcl_WrongNumArgs(interp, 2, objv, "conversation");
+			return TCL_ERROR;
+		}
+
+		if ((convo = tcl_validate_conversation(objv[2], interp)) == NULL)
+			return TCL_ERROR;
+		Tcl_SetStringObj(result, (char *)gaim_conversation_get_title(convo), -1);
+		break;
 	}
 
 	return TCL_OK;