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
7abb220e
Commit
7abb220e
authored
2 years ago
by
Rob Swindell
Browse files
Options
Downloads
Patches
Plain Diff
Fix irc.js line 750: TypeError: channels.current is undefined
And other potential occurrences of this when not in a channel
parent
37b42f98
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/irc.js
+25
-15
25 additions, 15 deletions
exec/irc.js
with
25 additions
and
15 deletions
exec/irc.js
+
25
−
15
View file @
7abb220e
...
...
@@ -664,6 +664,14 @@ function wait_for(commands) {
}
}
function
in_a_channel
()
{
if
(
channels
.
current
==
undefined
)
{
screen
.
print_line
(
"
\
x01H
\
x01RYou are not in a channel!
\
x01N
\
x01W
"
);
return
false
;
}
return
true
;
}
function
send_command
(
command
,
param
)
{
var
params
=
[
null
];
var
send_to
=
null
;
...
...
@@ -705,10 +713,7 @@ function send_command(command,param) {
channels
.
join
(
param
);
break
;
case
"
ME
"
:
if
(
channels
.
current
==
undefined
)
{
screen
.
print_line
(
"
\
x01H
\
x01RYou are not in a channel!
\
x01N
\
x01W
"
);
}
else
{
if
(
in_a_channel
())
{
channels
.
current
.
send
(
"
\
x01ACTION
"
+
param
+
"
\
x01
"
);
screen
.
print_line
(
"
\
x01N
\
x01B*
\
x01W
"
+
nick
+
"
"
+
param
);
}
...
...
@@ -723,7 +728,8 @@ function send_command(command,param) {
case
"
PART
"
:
// If the user specifies a channel, this SHOULD part that channel,
// not the current one.
channels
.
part
(
channels
.
current
.
name
,
param
);
if
(
in_a_channel
())
channels
.
part
(
channels
.
current
.
name
,
param
);
break
;
case
"
N
"
:
case
"
NEXT
"
:
...
...
@@ -743,19 +749,23 @@ function send_command(command,param) {
screen
.
update_statline
();
break
;
case
"
TOPIC
"
:
if
(
param
.
substr
(
0
,
1
)
==
'
#
'
||
param
.
substr
(
0
,
1
)
==
'
&
'
)
{
send_cmd
(
command
,
param
);
}
else
{
send_cmd
(
command
,
channels
.
current
.
name
+
"
"
+
param
);
if
(
in_a_channel
())
{
if
(
param
.
substr
(
0
,
1
)
==
'
#
'
||
param
.
substr
(
0
,
1
)
==
'
&
'
)
{
send_cmd
(
command
,
param
);
}
else
{
send_cmd
(
command
,
channels
.
current
.
name
+
"
"
+
param
);
}
}
break
;
case
"
KICK
"
:
if
(
param
.
substr
(
0
,
1
)
==
'
#
'
||
param
.
substr
(
0
,
1
)
==
'
&
'
)
{
send_cmd
(
command
,
param
);
}
else
{
send_cmd
(
command
,
channels
.
current
.
name
+
"
"
+
param
);
if
(
in_a_channel
())
{
if
(
param
.
substr
(
0
,
1
)
==
'
#
'
||
param
.
substr
(
0
,
1
)
==
'
&
'
)
{
send_cmd
(
command
,
param
);
}
else
{
send_cmd
(
command
,
channels
.
current
.
name
+
"
"
+
param
);
}
}
break
;
case
"
QUOTE
"
:
...
...
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