(defun erc-steg-encode (string) "encode" ;; if is not /command (if (not (string-match "/" string)) (progn (setq strr (shell-command-to-string (concat "echo \"" string "\" | /root/steg/stego/stego -e -l 4096 -f /root/steg/stego/dict -"))) (setq str (substring strr 0 (- (string-bytes strr) 1)))))) (defun erc-steg-decode () "decode" (progn (setq next-line-add-newlines t) (goto-char (point-min)) (if (looking-at "<") (progn (re-search-forward ">") (setq string (buffer-substring (+ (point) 1) (point-max))) (delete-region (+ (point) 1) (point-max)) (insert (shell-command-to-string (concat "echo \"" string "\" | /root/steg/stego/stego -d -f /root/steg/stego/dict -"))) (next-line 1))))) (add-hook 'erc-send-pre-hook 'erc-steg-encode) (add-hook 'erc-insert-modify-hook 'erc-steg-decode) (add-hook 'erc-send-modify-hook 'erc-steg-decode) ;;(remove-hook 'erc-send-pre-hook 'erc-steg-encode) ;;(remove-hook 'erc-insert-modify-hook 'erc-steg-decode) ;;(remove-hook 'erc-send-modify-hook 'erc-steg-decode)