Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
d2a44c4c
Commit
d2a44c4c
authored
Jan 29, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1003 Don't list MUC domain in rooms list.
parent
3d32f695
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
14 deletions
+24
-14
CHANGES.md
CHANGES.md
+1
-0
src/converse-muc.js
src/converse-muc.js
+23
-14
No files found.
CHANGES.md
View file @
d2a44c4c
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
-
#993
`moment.format`
is not a function error when sending a message.
-
#993
`moment.format`
is not a function error when sending a message.
-
#994 TypeError when using the
`user.login`
API.
-
#994 TypeError when using the
`user.login`
API.
-
#995
`ChildNode.replaceWith`
is not available in Internet Explorer or Safari. Use
`Node.replaceChild`
instead.
-
#995
`ChildNode.replaceWith`
is not available in Internet Explorer or Safari. Use
`Node.replaceChild`
instead.
-
#1003 Don't list MUC domain in rooms list.
## 3.3.1 (2018-01-18)
## 3.3.1 (2018-01-18)
...
...
src/converse-muc.js
View file @
d2a44c4c
...
@@ -1241,6 +1241,7 @@
...
@@ -1241,6 +1241,7 @@
// so we don't send out a presence stanza again.
// so we don't send out a presence stanza again.
return
this
;
return
this
;
}
}
const
stanza
=
$pres
({
const
stanza
=
$pres
({
'
from
'
:
_converse
.
connection
.
jid
,
'
from
'
:
_converse
.
connection
.
jid
,
'
to
'
:
this
.
getRoomJIDAndNick
(
nick
)
'
to
'
:
this
.
getRoomJIDAndNick
(
nick
)
...
@@ -2649,6 +2650,26 @@
...
@@ -2649,6 +2650,26 @@
this
.
removeSpinner
();
this
.
removeSpinner
();
},
},
roomStanzaItemToHTMLElement
(
room
)
{
if
(
!
u
.
isValidJID
(
room
.
getAttribute
(
'
jid
'
),
'
@
'
))
{
// Some XMPP servers return the MUC service in
// the list of rooms (see #1003).
return
null
;
}
const
name
=
Strophe
.
unescapeNode
(
room
.
getAttribute
(
'
name
'
)
||
room
.
getAttribute
(
'
jid
'
)
);
const
div
=
document
.
createElement
(
'
div
'
);
div
.
innerHTML
=
tpl_room_item
({
'
name
'
:
name
,
'
jid
'
:
room
.
getAttribute
(
'
jid
'
),
'
open_title
'
:
__
(
'
Click to open this room
'
),
'
info_title
'
:
__
(
'
Show more information on this room
'
)
});
return
div
.
firstChild
;
},
onRoomsFound
(
iq
)
{
onRoomsFound
(
iq
)
{
/* Handle the IQ stanza returned from the server, containing
/* Handle the IQ stanza returned from the server, containing
* all its public rooms.
* all its public rooms.
...
@@ -2661,21 +2682,9 @@
...
@@ -2661,21 +2682,9 @@
available_chatrooms
.
innerHTML
=
tpl_rooms_results
({
available_chatrooms
.
innerHTML
=
tpl_rooms_results
({
'
feedback_text
'
:
__
(
'
Rooms found
'
)
'
feedback_text
'
:
__
(
'
Rooms found
'
)
});
});
const
div
=
document
.
createElement
(
'
div
'
);
const
fragment
=
document
.
createDocumentFragment
();
const
fragment
=
document
.
createDocumentFragment
();
for
(
let
i
=
0
;
i
<
this
.
rooms
.
length
;
i
++
)
{
const
children
=
_
.
reject
(
_
.
map
(
this
.
rooms
,
this
.
roomStanzaItemToHTMLElement
),
_
.
isNil
)
const
name
=
Strophe
.
unescapeNode
(
_
.
each
(
children
,
(
child
)
=>
fragment
.
appendChild
(
child
));
this
.
rooms
[
i
].
getAttribute
(
'
name
'
)
||
this
.
rooms
[
i
].
getAttribute
(
'
jid
'
)
);
div
.
innerHTML
=
tpl_room_item
({
'
name
'
:
name
,
'
jid
'
:
this
.
rooms
[
i
].
getAttribute
(
'
jid
'
),
'
open_title
'
:
__
(
'
Click to open this room
'
),
'
info_title
'
:
__
(
'
Show more information on this room
'
)
});
fragment
.
appendChild
(
div
.
firstChild
);
}
available_chatrooms
.
appendChild
(
fragment
);
available_chatrooms
.
appendChild
(
fragment
);
const
input_el
=
this
.
el
.
querySelector
(
'
input#show-rooms
'
);
const
input_el
=
this
.
el
.
querySelector
(
'
input#show-rooms
'
);
input_el
.
classList
.
remove
(
'
hidden
'
)
input_el
.
classList
.
remove
(
'
hidden
'
)
...
...
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