~ysu/gemini-chatroom

e425cb1eb326e1221982ed4eedafa5d6ea3c0989 — vps 3 years ago bcd26e9
fixed spaces and new lines in usernames
1 files changed, 2 insertions(+), 6 deletions(-)

M bin/chat0/post
M bin/chat0/post => bin/chat0/post +2 -6
@@ 13,14 13,10 @@ if [ -z "$user" ]; then
fi

nstr=$(echo $QUERY_STRING | sed 's/\(%0A\|
\)/ /g' | sed 's/%/\\x/g')

# if [ -z $nstr]; then
#	echo -e "30 \r\n"
#	exit 0
# fi
nuser=$(echo ${user//[!a-z]/})

if [ $(cat last_message) != $nstr ]; then
	printf "($(date "+%D %R %Z")) $(echo $user: $nstr | awk '{printf "%9s\t%s\n", $1, $2}')\n" >> message_log
	printf "($(date "+%D %R %Z")) $(echo $nuser: $nstr | awk '{printf "%9s\t%s\n", $1, $2}')\n" >> message_log
	echo $nstr > last_message
	echo -e "30 /bin/chat$chatNum\r\n"
else