~ysu/gemini-chatroom

8884fd8f1224d1b1eeb611a5e83bd242c1bc3e62 — vps 2 years ago 822c9e6
changed style and added new line provention
1 files changed, 2 insertions(+), 2 deletions(-)

M bin/chat0/post
M bin/chat0/post => bin/chat0/post +2 -2
@@ 12,7 12,7 @@ if [ -z "$user" ]; then
	user="anon"
fi

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

if [ -z $nstr]; then
	echo -e "30 /\r\n"


@@ 20,7 20,7 @@ if [ -z $nstr]; then
fi

if [ $(cat last_message) != $nstr ]; then
	printf "($(date "+%D %R %Z"))\t\t$user: $nstr\n" >> message_log
	printf "($(date "+%D %R %Z"))\t\t$user:\t$nstr\n" >> message_log
	echo $nstr > last_message
else
	echo -e "40 Message failed! Reason: Spam protection\r\n"