shithub: xmpp

Download patch

ref: 81dfa6bbd4d005a33a1c0b0a64cd8d548f196175
parent: 7b3151f0a13823fccc39b2609155ffd1e5fd806f
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Tue Jun 4 10:33:52 EDT 2024

print outgoing messages with targets that won't echo the messages for us (thanks mouseboard)

--- a/xmpp.c
+++ b/xmpp.c
@@ -376,6 +376,7 @@
 static int
 cmdmsg(int fd, int, char **)
 {
+	Target *t;
 	char *s;
 	int res;
 
@@ -383,10 +384,13 @@
 		return 0;
 
 	s = readlines();
+	t = targets[curr];
+	if(t->type == Emucent || t->type == Erost)
+		print("[%s] (%s) me → %s\n", strtime(), t->name, s);
 	res = fprint(fd,
 		"<message to='%Ӽ' type='%Ӽ'><body>%Ӽ</body></message>",
-		targets[curr]->jid,
-		enttypes[targets[curr]->type],
+		t->jid,
+		enttypes[t->type],
 		s);
 	free(s);
 	return res;
@@ -413,6 +417,7 @@
 		['W'] cmdwho,      /*  muc.c:/^cmdwho      */
 	};
 	int argc;
+	Target *t;
 
 	cleaninput(utflen(s)+1);
 	if(*s == '/' && *(++s) != '/'){
@@ -439,10 +444,12 @@
 
 	if(curr < 0)
 		return 0;
-
+	t = targets[curr];
+	if(t->type == Emucent || t->type == Erost)
+		print("[%s] (%s) me → %s\n", strtime(), t->name, s);
 	return fprint(fd,
 		"<message to='%Ӽ' type='%Ӽ'><body>%Ӽ</body></message>",
-		targets[curr]->jid, enttypes[targets[curr]->type], s);
+		t->jid, enttypes[t->type], s);
 }
 
 static void