This repository was archived by the owner on Mar 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotify.irc
More file actions
58 lines (53 loc) · 1.55 KB
/
notify.irc
File metadata and controls
58 lines (53 loc) · 1.55 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
## notify - 120
# to: spline
on #-notify_signon 120 "*" {
@ :serv = servernum()
@ :nick = encode($tolower($0))
@ msc.notify.u[$serv][$nick] = [$1]
@ msc.notify.n[$serv][$nick] = time()
^assign -msc.notify.f[$serv][$nick]
}
on #-notify_signoff 120 "*" {@ msc.notify.f[$servernum()][$encode($tolower($0))] = time()}
alias notify {
if ([$#] && [$0] != [+]) {
fe ($split(, $*)) temp {
switch ($temp) {
(-) {
//^notify -
xecho -s -b Cleared notification list
}
(-%) {
@ :nick = rest(1 $temp)
xecho -s -b Removed "$nick" from the notification list
//^notify $temp
^assign -msc.notify[$servernum()][$encode($tolower($nick))]
}
(*) {
xecho -s -b Added "$strip(+ $temp)" to the notification list
//^notify $temp
}
}
}
} else {
@ :serv = servernum()
echo +- 57Nick ----- 57User@57Host ---------------------------- 57Signon ---- 57Signoff ----+
fe ($notify(${[$0] ? [on] : []})) temp {
@ :nick = encode($tolower($temp))
@ :u = msc.notify.u[$serv][$nick]
@ :n = msc.notify.n[$serv][$nick]
@ :f = msc.notify.f[$serv][$nick]
fmt.str.disp_enc ${n && !f ? [52] : [51]}$[10]temp $[38]{u ? u : [-]} 57$[11]{n ? strftime($n %m/%d@%H\:%M) : [-]} $[11]{f ? strftime($f %m/%d@%H\:%M) : [-]}
}
fmt.hdr.disp_enc
}
}
alias unnotify {
if ([$#]) {
fe ($*) temp {
push string -$temp
}
notify $string
} else {
xecho -s -b Usage: UNNOTIFY <nickname>
}
}