Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
4e4cd679
Commit
4e4cd679
authored
7 years ago
by
echicken
Browse files
Options
Downloads
Patches
Plain Diff
Optionally notify via email
parent
93d8f4e5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
xtrn/chat_pager/example-settings.ini
+7
-0
7 additions, 0 deletions
xtrn/chat_pager/example-settings.ini
xtrn/chat_pager/lib.js
+21
-0
21 additions, 0 deletions
xtrn/chat_pager/lib.js
xtrn/chat_pager/page_sysop.js
+9
-0
9 additions, 0 deletions
xtrn/chat_pager/page_sysop.js
with
37 additions
and
0 deletions
xtrn/chat_pager/example-settings.ini
+
7
−
0
View file @
4e4cd679
...
...
@@ -18,3 +18,10 @@ irc_pull = true
irc_server
=
irc.synchro.net
irc_port
=
6667
irc_channel
=
#my_bbs_channel
[email]
enabled
=
true
recipients
=
sysop@mybbs.synchro.net,1234567890@sms.celluar.blah
from
=
noreply@mybbs.synchro.net
subject_format
=
%s is paging the sysop
body_format
=
%s is is paging the sysop to chat on %s
This diff is collapsed.
Click to expand it.
xtrn/chat_pager/lib.js
+
21
−
0
View file @
4e4cd679
...
...
@@ -82,3 +82,24 @@ var Scanner = function () {
this
.
reset
();
}
function
notify_via_email
(
settings
,
un
)
{
var
usr
=
new
User
(
un
);
var
subject
=
format
(
settings
.
subject_format
,
usr
.
alias
);
var
body
=
format
(
settings
.
body_format
,
usr
.
alias
,
system
.
name
);
var
rcpt_list
=
settings
.
recipients
.
split
(
'
,
'
).
map
(
function
(
e
)
{
return
{
to
:
e
,
to_net_type
:
5
,
to_net_addr
:
e
};
}
);
var
header
=
{
from
:
settings
.
from
,
subject
:
subject
,
to
:
rcpt_list
[
0
].
to
,
to_net_type
:
5
,
to_net_addr
:
rcpt_list
[
0
].
to_net_addr
};
rcpt_list
.
shift
();
var
mb
=
new
MsgBase
(
'
mail
'
);
mb
.
open
();
mb
.
save_msg
(
header
,
body
,
rcpt_list
);
mb
.
close
();
}
This diff is collapsed.
Click to expand it.
xtrn/chat_pager/page_sysop.js
+
9
−
0
View file @
4e4cd679
...
...
@@ -8,17 +8,22 @@ function get_node_response_time(filename) {
}
function
await_page_response
(
settings
,
frame
)
{
if
(
!
settings
.
queue
.
disabled
)
{
var
queue
=
new
Queue
(
settings
.
queue
.
queue_name
);
var
valname
=
"
chat_
"
+
bbs
.
node_num
;
}
else
{
var
valname
=
system
.
ctrl_dir
+
'
syspage_response.
'
+
bbs
.
node_num
;
}
if
(
settings
.
email
.
enabled
)
notify_via_email
(
settings
.
email
,
user
.
number
);
var
answered
=
false
;
var
stime
=
system
.
timer
;
var
utime
=
system
.
timer
;
var
progress_bar
=
new
ProgressBar
(
1
,
2
,
frame
.
width
,
frame
);
progress_bar
.
init
();
while
(
(
system
.
timer
-
stime
)
*
1000
<
settings
.
terminal
.
wait_time
&&
console
.
inkey
(
K_NONE
,
5
)
==
''
&&
...
...
@@ -43,12 +48,16 @@ function await_page_response(settings, frame) {
bbs
.
node_sync
();
yield
();
}
progress_bar
.
set_progress
(
100
);
if
(
frame
.
cycle
())
{
console
.
gotoxy
(
console
.
screen_columns
,
console
.
screen_rows
);
}
if
(
settings
.
queue
.
disabled
&&
file_exists
(
valname
))
file_remove
(
valname
);
return
answered
;
}
function
main
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment