8
|
1 |
-- BEEPING ON ALL MESSAGES |
|
2 |
|
|
3 |
beep_enable = false |
|
4 |
|
|
5 |
-- FIXME: add generic cid generation routine |
|
6 |
boolean_cid = main.command ( 'beep', |
|
7 |
function ( args ) |
|
8 |
local enable = yesno ( args ) |
|
9 |
if enable ~= nil then |
|
10 |
beep_enable = enable |
|
11 |
end |
|
12 |
if beep_enable then |
|
13 |
hooks_d['hook-message-in'].beep = main.beep |
|
14 |
print ( "Beep on message is enabled" ) |
|
15 |
else |
|
16 |
hooks_d['hook-message-in'].beep = nil |
|
17 |
print ( "Beep on message is disabled" ) |
|
18 |
end |
|
19 |
end, { 'enable', 'disable', 'yes', 'no', 'true', 'false', 'on', 'off' } ) |
|
20 |
|
|
21 |
commands_help['beep'] = "[enable|disable|on|off|yes|no|true|false]\n\nEnables or disables beeping on all messages.\nIf state is omitted, prints current state." |
|
22 |
|
|
23 |
-- vim: se ts=4: -- |