dot

packages and services management
Log | Files | Refs | README

commit 84b0ded000853a67b1a69ed65fb8860dee58ee1f
parent 04576535db6b2a950bf8fa9242c03e5c3e7a9fed
Author: josuah <mail@josuah.net>
Date:   Sun, 28 Aug 2016 20:03:44 +0200

irc: Fix ......... [done]

Diffstat:
Mbin/irc | 9++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/bin/irc b/bin/irc @@ -12,7 +12,7 @@ NICK="${NICK-$(whoami)}" FULLNAME='With netcat and a script as a client' NICK_LEN=14 NL=' -' CR=' ' +' CR="$(printf '\015')" C_A="$(printf '\001')" DIR="$HOME/.cache/irc" @@ -34,7 +34,7 @@ write() # connect() { - local srv="$1" user="$(tail "$1/NICK" | tee -a ~/log)" + local srv="$1" user="$NICK" mkdir -p "$srv" [ -p "$srv/IN" ] || mkfifo "$srv/IN" @@ -86,8 +86,7 @@ input() write "$srv" "JOIN $arg" ;; ME | ACTION ) - CA="$(printf '\001')" - write "$srv" "PRIVMSG $chan :${CA}ACTION ${arg}${CA}" + write "$srv" "PRIVMSG $chan :${C_A}ACTION ${arg}${C_A}" ;; TOPIC | LIST | MOTD ) write "$srv" "TOPIC ${arg-chan}" @@ -179,7 +178,7 @@ output() then printf '%s\n' "$trailing" > "$srv/NICK" fi ;; - QUIT | NOTICE | [0-9][0-9][0-9] | * ) chan="SERVER" ;; + QUIT | NOTICE | [0-9][0-9][0-9] | * | '' ) chan=SERVER ;; esac # Execute action