[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch to 1.5.7: TAB in empty input area inserts "/msg nick "



Folks,

Here's a patch to 1.5.7 that makes it so typing TAB when the input area
is empty inserts "/msg xxx ", where xxx is the nick of the last person
who /msg'ed you.
--
Francis Litterio
franl@world.std.com
http://world.std.com/~franl/
PGP public keys available on keyservers.



diff -wr -U 5 xchat-1.5.7-dist/src/common/inbound.c xchat-1.5.7/src/common/inbound.c
--- xchat-1.5.7-dist/src/common/inbound.c	Fri Jul 21 05:40:04 2000
+++ xchat-1.5.7/src/common/inbound.c	Sun Aug 27 12:17:54 2000
@@ -164,10 +164,13 @@
 		return;
 	}
 	sess = find_session_from_nick (from, serv);
 	if (!sess)
 		sess = serv->front_session;
+
+	strcpy(sess->lastmsgfrom, from);
+
 	EMIT_SIGNAL (XP_TE_PRIVMSG, sess, from, text, NULL, NULL, 0);
 }
 
 void
 channel_action (struct session *sess, char *tbuf, char *chan, char *from,
diff -wr -U 5 xchat-1.5.7-dist/src/common/xchat.h xchat-1.5.7/src/common/xchat.h
--- xchat-1.5.7-dist/src/common/xchat.h	Fri Aug 25 00:18:06 2000
+++ xchat-1.5.7/src/common/xchat.h	Sun Aug 27 12:23:23 2000
@@ -230,11 +230,11 @@
 	int limit;						  /* channel user limit */
 	int channelflags;				  /* channel flags (bitmap) */
 	int logfd;
 
 	char lastnick[NICKLEN];			  /* last nick you /msg'ed */
-
+	char lastmsgfrom[64];           /* The last nick who /msg'ed you */
 	struct history history;
 
 	int ops;								/* num. of ops in channel */
 	int hops;						  /* num. of half-oped users */
 	int voices;							/* num. of voiced people */
diff -wr -U 5 xchat-1.5.7-dist/src/fe-gtk/fkeys.c xchat-1.5.7/src/fe-gtk/fkeys.c
--- xchat-1.5.7-dist/src/fe-gtk/fkeys.c	Sat Aug 12 09:30:06 2000
+++ xchat-1.5.7/src/fe-gtk/fkeys.c	Sun Aug 27 12:17:54 2000
@@ -1761,10 +1761,19 @@
 	text = gtk_entry_get_text (GTK_ENTRY (t));
 
 	sess = find_session_from_inputgad (t);
 	if (sess == NULL)
 		return 0;
+
+ 	if (strlen(text) == 0)
+ 	{
+ 		char newtext[128] = { 0 };
+ 		sprintf(newtext, "/msg %s ", sess->lastmsgfrom);
+ 		gtk_entry_set_text (GTK_ENTRY (t), newtext);
+ 		return 2;
+ 	}
+
 	if (sess->is_dialog)
 		return 0;
 	
 	len = strlen (text);
 	if (!strchr (text, ' '))
-
XChat-discuss: mailing list for XChat users
Archive:       http://mail.nl.linux.org/lists/
Posted By:     Francis Litterio <franl@world.std.com>