File: newaway

package info (click to toggle)
epic4 1%3A3.0-2.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,756 kB
  • sloc: ansic: 56,285; makefile: 631; sh: 161; perl: 30
file content (38 lines) | stat: -rw-r--r-- 862 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# newaway.m
# v1.2 by Joseph Carter <knghtbrd@debian.org>
# v1.0-1.1 by Matthew Green
#
# Public domain, as was the original
#
# Changes:
#  28 Jun 1999, v1.2 - rewrote the whole thing for epic4  =>
#   5 Jul 1999, v1.3 - replaced some @ var ='s with ^assign
#                    - moved the whois check out of _na.show
#                    - we now display away differently if in whois

package newaway

alias _na.show {
  @ :nick = encode($tolower($0))
  @ :away = encode($tolower($1-))

  unless (_na.nick[$nick] == away) {
    @ _na.nick[$nick] = away
    return 1
  }
  return 0
}

on #^311 311 "*" ^assign _na.whois.$lastserver() 1
on #^318 311 "*" ^assign -_na.whois.$lastserver()

on ^301 "*" {
  if (_na.whois[$lastserver()]) {
    xecho -b away     : $1-
  } elsif (_na.show($*)) {
    xecho -b $0 is away: $1-
  }
}

on ^unload "newaway *" purge _na