From 3a7a205af47b17b887da5ffffba65c9515e13bcb Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Wed, 10 Jan 2018 23:37:33 +0000
Subject: [PATCH] This script may be used in place of showmsghdr.js if you
 already have a custom msghdr.asc and want to continue to use it (with
 avatars). Just add @exec:showmsgavatar@ (uppercase) below your custom header
 in msghdr.asc.

---
 exec/showmsgavatar.js | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 exec/showmsgavatar.js

diff --git a/exec/showmsgavatar.js b/exec/showmsgavatar.js
new file mode 100644
index 0000000000..5bac36120a
--- /dev/null
+++ b/exec/showmsgavatar.js
@@ -0,0 +1,21 @@
+// $Id$
+
+// This can be loaded from text/menu/msghdr.asc via @EXEC:SHOWMSGAVATAR@
+// Don't forget to include or exclude the blank line after if you do
+// (or don't) want a blank line separating message headers and body text
+
+// This script may be used instead of (not in addition to) showmsghdr.js
+// Use this script if you have/want a custom message header defined in
+// msghdr.asc, i.e. with @-codes (not using text.dat strings).
+// If you do not want the avatar right-justified, copy this file to your
+// mods directory and change that parameter below.
+
+load('smbdefs.js');
+var   USER_ANSI         =(1<<1);
+
+// Avatar support here:
+if(!(bbs.msg_attr&MSG_ANONYMOUS) && console.term_supports(USER_ANSI)) {
+	var Avatar = load({}, 'avatar_lib.js');
+	Avatar.draw(bbs.msg_from_ext, bbs.msg_from, bbs.msg_from_net, /* above: */true, /* right-justified: */true);
+	console.attributes = 0;	// Clear the background attribute as the next line might scroll, filling with BG attribute
+}
\ No newline at end of file
-- 
GitLab