Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Commits
97b35e04
Commit
97b35e04
authored
May 29, 2013
by
mcmlxxix
Browse files
join all existing channels on client connect (or reconnect). removed useless join() argument
parent
52ad0774
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
exec/load/json-chat.js
exec/load/json-chat.js
+11
-7
No files found.
exec/load/json-chat.js
View file @
97b35e04
...
...
@@ -27,12 +27,6 @@ function JSONChat(usernum,jsonclient,host,port) {
return
settings
;
});
if
(
!
this
.
client
)
{
if
(
!
host
||
isNaN
(
port
))
throw
(
"
invalid client arguments
"
);
this
.
client
=
new
JSONClient
(
host
,
port
);
}
this
.
connect
=
function
()
{
var
usr
;
if
(
usernum
>
0
&&
system
.
username
(
usernum
))
...
...
@@ -41,10 +35,20 @@ function JSONChat(usernum,jsonclient,host,port) {
this
.
nick
=
new
Nick
(
usr
.
alias
,
system
.
name
,
usr
.
ip_address
);
else
if
(
user
&&
user
.
number
>
0
)
this
.
nick
=
new
Nick
(
user
.
alias
,
system
.
name
,
user
.
ip_address
);
if
(
!
this
.
client
)
{
if
(
!
host
||
isNaN
(
port
))
throw
(
"
invalid client arguments
"
);
this
.
client
=
new
JSONClient
(
host
,
port
);
}
this
.
client
.
connect
();
if
(
this
.
nick
)
this
.
client
.
subscribe
(
"
chat
"
,
"
channels.
"
+
this
.
nick
.
name
+
"
.messages
"
);
else
throw
(
"
invalid user number
"
);
for
(
var
c
in
this
.
channels
)
this
.
join
(
c
.
name
);
}
this
.
submit
=
function
(
target
,
str
)
{
...
...
@@ -82,7 +86,7 @@ function JSONChat(usernum,jsonclient,host,port) {
}
}
this
.
join
=
function
(
target
,
str
)
{
this
.
join
=
function
(
target
)
{
this
.
client
.
subscribe
(
"
chat
"
,
"
channels.
"
+
target
+
"
.messages
"
);
this
.
channels
[
target
.
toUpperCase
()]
=
new
Channel
(
target
);
var
index
=
(
-
1
*
this
.
settings
.
MAX_HISTORY
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment