Advertisement
4da

bitlbee erc last user send-hook

4da
Mar 16th, 2012
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 1.12 KB | None | 0 0
  1. ; send input to user (last talked to) (bitlbee, erc)
  2. (setq bitlbee-target "")
  3. (defun bitlbee-update-target (msg)
  4.   (if (string= "&bitlbee" (buffer-name))
  5.       (if (string-match "\\([^:]*: \\)" msg)
  6.       (setq bitlbee-target (match-string 1 msg))
  7.     (if (not (or
  8.           (string-match "account" msg)
  9.           (string-match "channel" msg)
  10.           (string-match "chat" msg)
  11.           (string-match "add" msg)
  12.           (string-match "info" msg)
  13.           (string-match "remove" msg)
  14.           (string-match "block" msg)
  15.           (string-match "allow" msg)
  16.           (string-match "otr" msg)
  17.           (string-match "set" msg)
  18.           (string-match "help" msg)
  19.           (string-match "save" msg)
  20.           (string-match "rename" msg)
  21.           (string-match "yes" msg)
  22.           (string-match "no" msg)
  23.           (string-match "qlist" msg)
  24.           (string-match "register" msg)
  25.           (string-match "identify" msg)
  26.           (string-match "drop" msg)
  27.           (string-match "blist" msg)
  28.           (string-match "group" msg)
  29.           (string-match "transfer" msg)
  30.           ))
  31.         (setq str (concat bitlbee-target msg))))))
  32.  
  33. (add-hook 'erc-send-pre-hook 'bitlbee-update-target)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement