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
be1be353
Commit
be1be353
authored
Dec 20, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't render the lock icon when the MUC doesn't qualify
Updates #1180
parent
9aca32ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
11 deletions
+27
-11
dist/converse.js
dist/converse.js
+13
-1
spec/omemo.js
spec/omemo.js
+2
-9
src/converse-omemo.js
src/converse-omemo.js
+12
-1
No files found.
dist/converse.js
View file @
be1be353
...
...
@@ -56406,6 +56406,18 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
this.model.save({
'omemo_active': !this.model.get('omemo_active')
});
},
renderOMEMOToolbarButton() {
if (this.model.get('membersonly') && this.model.get('nonanonymous')) {
this.__super__.renderOMEMOToolbarButton.apply(arguments);
} else {
const icon = this.el.querySelector('.toggle-omemo');
if (icon) {
icon.parentElement.removeChild(icon);
}
}
}
}
...
...
@@ -57194,7 +57206,7 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
}
async function onOccupantAdded(chatroom, occupant) {
if (occupant.isSelf() || !chatroom.get('nonanonymous')) {
if (occupant.isSelf() || !chatroom.get('nonanonymous')
|| !chatroom.get('membersonly')
) {
return;
}
spec/omemo.js
View file @
be1be353
...
...
@@ -1255,10 +1255,7 @@
view
.
model
.
save
({
'
nonanonymous
'
:
false
,
'
semianonymous
'
:
true
});
await
test_utils
.
waitUntil
(()
=>
!
view
.
model
.
get
(
'
omemo_supported
'
));
toggle
=
toolbar
.
querySelector
(
'
.toggle-omemo
'
);
expect
(
_
.
isNull
(
toggle
)).
toBe
(
false
);
expect
(
u
.
hasClass
(
'
fa-unlock
'
,
toggle
)).
toBe
(
true
);
expect
(
u
.
hasClass
(
'
fa-lock
'
,
toggle
)).
toBe
(
false
);
expect
(
u
.
hasClass
(
'
disabled
'
,
toggle
)).
toBe
(
true
);
expect
(
_
.
isNull
(
toggle
)).
toBe
(
true
);
expect
(
view
.
model
.
get
(
'
omemo_supported
'
)).
toBe
(
false
);
view
.
model
.
save
({
'
nonanonymous
'
:
true
,
'
semianonymous
'
:
false
});
...
...
@@ -1273,11 +1270,7 @@
view
.
model
.
save
({
'
membersonly
'
:
false
,
'
open
'
:
true
});
await
test_utils
.
waitUntil
(()
=>
!
view
.
model
.
get
(
'
omemo_supported
'
));
toggle
=
toolbar
.
querySelector
(
'
.toggle-omemo
'
);
expect
(
_
.
isNull
(
toggle
)).
toBe
(
false
);
expect
(
u
.
hasClass
(
'
fa-unlock
'
,
toggle
)).
toBe
(
true
);
expect
(
u
.
hasClass
(
'
fa-lock
'
,
toggle
)).
toBe
(
false
);
expect
(
u
.
hasClass
(
'
disabled
'
,
toggle
)).
toBe
(
true
);
expect
(
view
.
model
.
get
(
'
omemo_supported
'
)).
toBe
(
false
);
expect
(
_
.
isNull
(
toggle
)).
toBe
(
true
);
view
.
model
.
save
({
'
membersonly
'
:
true
,
'
open
'
:
false
});
await
test_utils
.
waitUntil
(()
=>
view
.
model
.
get
(
'
omemo_supported
'
));
...
...
src/converse-omemo.js
View file @
be1be353
...
...
@@ -443,6 +443,17 @@ converse.plugins.add('converse-omemo', {
}
ev
.
preventDefault
();
this
.
model
.
save
({
'
omemo_active
'
:
!
this
.
model
.
get
(
'
omemo_active
'
)});
},
renderOMEMOToolbarButton
()
{
if
(
this
.
model
.
get
(
'
membersonly
'
)
&&
this
.
model
.
get
(
'
nonanonymous
'
))
{
this
.
__super__
.
renderOMEMOToolbarButton
.
apply
(
arguments
);
}
else
{
const
icon
=
this
.
el
.
querySelector
(
'
.toggle-omemo
'
);
if
(
icon
)
{
icon
.
parentElement
.
removeChild
(
icon
);
}
}
}
}
},
...
...
@@ -1121,7 +1132,7 @@ converse.plugins.add('converse-omemo', {
}
async
function
onOccupantAdded
(
chatroom
,
occupant
)
{
if
(
occupant
.
isSelf
()
||
!
chatroom
.
get
(
'
nonanonymous
'
))
{
if
(
occupant
.
isSelf
()
||
!
chatroom
.
get
(
'
nonanonymous
'
)
||
!
chatroom
.
get
(
'
membersonly
'
)
)
{
return
;
}
if
(
chatroom
.
get
(
'
omemo_active
'
))
{
...
...
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