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
145ee882
Commit
145ee882
authored
May 09, 2019
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Start handling error presences in MUC model
parent
1be9958a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
3 deletions
+29
-3
dist/converse.js
dist/converse.js
+10
-1
src/headless/converse-muc.js
src/headless/converse-muc.js
+9
-1
src/headless/dist/converse-headless.js
src/headless/dist/converse-headless.js
+10
-1
No files found.
dist/converse.js
View file @
145ee882
...
...
@@ -60970,7 +60970,16 @@ _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins.add('converse-muc
*/
onPresence(pres) {
if (pres.getAttribute('type') === 'error') {
this.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.DISCONNECTED);
// TODO: currently showErrorMessageFromPresence handles
// 'error" presences in converse-muc-views.
// Instead, they should be handled here and the presence
// handler removed from there.
if (sizzle(`error not-authorized[xmlns="${Strophe.NS.STANZAS}"]`, pres).length) {
this.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.PASSWORD_REQUIRED);
} else {
this.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.DISCONNECTED);
}
return;
}
src/headless/converse-muc.js
View file @
145ee882
...
...
@@ -1116,7 +1116,15 @@ converse.plugins.add('converse-muc', {
*/
onPresence
(
pres
)
{
if
(
pres
.
getAttribute
(
'
type
'
)
===
'
error
'
)
{
this
.
save
(
'
connection_status
'
,
converse
.
ROOMSTATUS
.
DISCONNECTED
);
// TODO: currently showErrorMessageFromPresence handles
// 'error" presences in converse-muc-views.
// Instead, they should be handled here and the presence
// handler removed from there.
if
(
sizzle
(
`error not-authorized[xmlns="
${
Strophe
.
NS
.
STANZAS
}
"]`
,
pres
).
length
)
{
this
.
save
(
'
connection_status
'
,
converse
.
ROOMSTATUS
.
PASSWORD_REQUIRED
);
}
else
{
this
.
save
(
'
connection_status
'
,
converse
.
ROOMSTATUS
.
DISCONNECTED
);
}
return
;
}
const
is_self
=
pres
.
querySelector
(
"
status[code='110']
"
);
...
...
src/headless/dist/converse-headless.js
View file @
145ee882
...
...
@@ -39257,7 +39257,16 @@ _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].plugins.add('converse-muc
*/
onPresence(pres) {
if (pres.getAttribute('type') === 'error') {
this.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.DISCONNECTED);
// TODO: currently showErrorMessageFromPresence handles
// 'error" presences in converse-muc-views.
// Instead, they should be handled here and the presence
// handler removed from there.
if (sizzle(`error not-authorized[xmlns="${Strophe.NS.STANZAS}"]`, pres).length) {
this.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.PASSWORD_REQUIRED);
} else {
this.save('connection_status', _converse_core__WEBPACK_IMPORTED_MODULE_3__["default"].ROOMSTATUS.DISCONNECTED);
}
return;
}
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