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
99953636
Commit
99953636
authored
Sep 07, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1014 Don't show IRC gateway as MUC prefill
parent
353bbef0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
34 deletions
+32
-34
dist/converse.js
dist/converse.js
+18
-17
src/converse-muc-views.js
src/converse-muc-views.js
+13
-16
src/converse-push.js
src/converse-push.js
+1
-1
No files found.
dist/converse.js
View file @
99953636
...
@@ -68123,9 +68123,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -68123,9 +68123,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
/* Send an IQ stanza to the server asking for all groupchats
/* Send an IQ stanza to the server asking for all groupchats
*/
*/
_converse.connection.sendIQ($iq({
_converse.connection.sendIQ($iq({
to
: this.model.get('muc_domain'),
'to'
: this.model.get('muc_domain'),
from
: _converse.connection.jid,
'from'
: _converse.connection.jid,
type
: "get"
'type'
: "get"
}).c("query", {
}).c("query", {
xmlns: Strophe.NS.DISCO_ITEMS
xmlns: Strophe.NS.DISCO_ITEMS
}), this.onRoomsFound.bind(this), this.informNoRoomsFound.bind(this), 5000);
}), this.onRoomsFound.bind(this), this.informNoRoomsFound.bind(this), 5000);
...
@@ -68140,7 +68140,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -68140,7 +68140,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
setDomain(ev) {
setDomain(ev) {
this.model.save({
this.model.save({
muc_domain
: ev.target.value
'muc_domain'
: ev.target.value
});
});
},
},
...
@@ -68175,8 +68175,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -68175,8 +68175,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
parseRoomDataFromEvent(form) {
parseRoomDataFromEvent(form) {
const data = new FormData(form);
const data = new FormData(form);
const jid = data.get('chatroom');
const jid = data.get('chatroom');
const server = Strophe.getDomainFromJid(jid);
this.model.save('muc_domain', Strophe.getDomainFromJid(jid));
this.model.save('muc_domain', server);
return {
return {
'jid': jid,
'jid': jid,
'nick': data.get('nickname')
'nick': data.get('nickname')
...
@@ -69758,9 +69757,17 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -69758,9 +69757,17 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
* set the MUC domain in the "Add groupchat" modal.
* set the MUC domain in the "Add groupchat" modal.
*/
*/
function featureAdded(feature) {
function featureAdded(feature) {
if (feature.get('var') === Strophe.NS.MUC && f.includes('conference', feature.entity.identities.pluck('category'))) {
if (!feature) {
return;
}
if (feature.get('var') === Strophe.NS.MUC) {
feature.getIdentity('conference', 'text').then(identity => {
if (identity) {
setMUCDomain(feature.get('from'), controlboxview);
setMUCDomain(feature.get('from'), controlboxview);
}
}
});
}
}
}
_converse.api.waitUntil('discoInitialized').then(() => {
_converse.api.waitUntil('discoInitialized').then(() => {
...
@@ -69768,15 +69775,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
...
@@ -69768,15 +69775,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
// initialized. We're only interested in MUC
// initialized. We're only interested in MUC
_converse.disco_entities.each(entity => {
_converse.disco_entities.each(entity => featureAdded(entity.features.findWhere({
const feature = entity.features.findWhere({
'var': Strophe.NS.MUC
'var': Strophe.NS.MUC
});
})));
if (feature) {
featureAdded(feature);
}
});
}).catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR));
}).catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR));
}
}
src/converse-muc-views.js
View file @
99953636
...
@@ -399,9 +399,9 @@
...
@@ -399,9 +399,9 @@
*/
*/
_converse
.
connection
.
sendIQ
(
_converse
.
connection
.
sendIQ
(
$iq
({
$iq
({
to
:
this
.
model
.
get
(
'
muc_domain
'
),
'
to
'
:
this
.
model
.
get
(
'
muc_domain
'
),
from
:
_converse
.
connection
.
jid
,
'
from
'
:
_converse
.
connection
.
jid
,
type
:
"
get
"
'
type
'
:
"
get
"
}).
c
(
"
query
"
,
{
xmlns
:
Strophe
.
NS
.
DISCO_ITEMS
}),
}).
c
(
"
query
"
,
{
xmlns
:
Strophe
.
NS
.
DISCO_ITEMS
}),
this
.
onRoomsFound
.
bind
(
this
),
this
.
onRoomsFound
.
bind
(
this
),
this
.
informNoRoomsFound
.
bind
(
this
),
this
.
informNoRoomsFound
.
bind
(
this
),
...
@@ -417,7 +417,7 @@
...
@@ -417,7 +417,7 @@
},
},
setDomain
(
ev
)
{
setDomain
(
ev
)
{
this
.
model
.
save
({
muc_domain
:
ev
.
target
.
value
});
this
.
model
.
save
({
'
muc_domain
'
:
ev
.
target
.
value
});
},
},
setNick
(
ev
)
{
setNick
(
ev
)
{
...
@@ -451,8 +451,7 @@
...
@@ -451,8 +451,7 @@
parseRoomDataFromEvent
(
form
)
{
parseRoomDataFromEvent
(
form
)
{
const
data
=
new
FormData
(
form
);
const
data
=
new
FormData
(
form
);
const
jid
=
data
.
get
(
'
chatroom
'
);
const
jid
=
data
.
get
(
'
chatroom
'
);
const
server
=
Strophe
.
getDomainFromJid
(
jid
);
this
.
model
.
save
(
'
muc_domain
'
,
Strophe
.
getDomainFromJid
(
jid
));
this
.
model
.
save
(
'
muc_domain
'
,
server
);
return
{
return
{
'
jid
'
:
jid
,
'
jid
'
:
jid
,
'
nick
'
:
data
.
get
(
'
nickname
'
)
'
nick
'
:
data
.
get
(
'
nickname
'
)
...
@@ -1954,22 +1953,20 @@
...
@@ -1954,22 +1953,20 @@
* set the MUC domain in the "Add groupchat" modal.
* set the MUC domain in the "Add groupchat" modal.
*/
*/
function
featureAdded
(
feature
)
{
function
featureAdded
(
feature
)
{
if
(
feature
.
get
(
'
var
'
)
===
Strophe
.
NS
.
MUC
&&
if
(
!
feature
)
{
return
;
}
f
.
includes
(
'
conference
'
,
feature
.
entity
.
identities
.
pluck
(
'
category
'
)))
{
if
(
feature
.
get
(
'
var
'
)
===
Strophe
.
NS
.
MUC
)
{
feature
.
getIdentity
(
'
conference
'
,
'
text
'
).
then
(
identity
=>
{
if
(
identity
)
{
setMUCDomain
(
feature
.
get
(
'
from
'
),
controlboxview
);
setMUCDomain
(
feature
.
get
(
'
from
'
),
controlboxview
);
}
}
});
}
}
}
_converse
.
api
.
waitUntil
(
'
discoInitialized
'
).
then
(()
=>
{
_converse
.
api
.
waitUntil
(
'
discoInitialized
'
).
then
(()
=>
{
_converse
.
api
.
listen
.
on
(
'
serviceDiscovered
'
,
featureAdded
);
_converse
.
api
.
listen
.
on
(
'
serviceDiscovered
'
,
featureAdded
);
// Features could have been added before the controlbox was
// Features could have been added before the controlbox was
// initialized. We're only interested in MUC
// initialized. We're only interested in MUC
_converse
.
disco_entities
.
each
((
entity
)
=>
{
_converse
.
disco_entities
.
each
(
entity
=>
featureAdded
(
entity
.
features
.
findWhere
({
'
var
'
:
Strophe
.
NS
.
MUC
})));
const
feature
=
entity
.
features
.
findWhere
({
'
var
'
:
Strophe
.
NS
.
MUC
});
if
(
feature
)
{
featureAdded
(
feature
)
}
});
}).
catch
(
_
.
partial
(
_converse
.
log
,
_
,
Strophe
.
LogLevel
.
ERROR
));
}).
catch
(
_
.
partial
(
_converse
.
log
,
_
,
Strophe
.
LogLevel
.
ERROR
));
}
}
...
...
src/converse-push.js
View file @
99953636
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
return
;
return
;
}
}
_converse
.
api
.
disco
.
getIdentity
(
'
pubsub
'
,
'
push
'
,
push_app_server
.
jid
)
_converse
.
api
.
disco
.
getIdentity
(
'
pubsub
'
,
'
push
'
,
push_app_server
.
jid
)
.
then
(
(
identity
)
=>
{
.
then
(
identity
=>
{
if
(
!
identity
)
{
if
(
!
identity
)
{
return
_converse
.
log
(
return
_converse
.
log
(
`Not enabling push the service "
${
push_app_server
.
jid
}
", it doesn't have the right disco identtiy.`
,
`Not enabling push the service "
${
push_app_server
.
jid
}
", it doesn't have the right disco identtiy.`
,
...
...
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