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
7b2d64b0
Commit
7b2d64b0
authored
Oct 23, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `_converse.api.send` instead of `_converse.connection.send`
so that we can emit an event when sending a stanza.
parent
02f1b331
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
21 deletions
+21
-21
src/converse-muc-views.js
src/converse-muc-views.js
+2
-2
src/headless/converse-chatboxes.js
src/headless/converse-chatboxes.js
+3
-3
src/headless/converse-core.js
src/headless/converse-core.js
+3
-3
src/headless/converse-disco.js
src/headless/converse-disco.js
+1
-1
src/headless/converse-muc.js
src/headless/converse-muc.js
+7
-7
src/headless/converse-roster.js
src/headless/converse-roster.js
+5
-5
No files found.
src/converse-muc-views.js
View file @
7b2d64b0
...
...
@@ -949,7 +949,7 @@ converse.plugins.add('converse-muc-views', {
if
(
!
this
.
verifyRoles
([
'
visitor
'
,
'
participant
'
,
'
moderator
'
]))
{
break
;
}
_converse
.
connection
.
send
(
$pres
({
_converse
.
api
.
send
(
$pres
({
from
:
_converse
.
connection
.
jid
,
to
:
this
.
model
.
getRoomJIDAndNick
(
match
[
2
]),
id
:
_converse
.
connection
.
getUniqueId
()
...
...
@@ -999,7 +999,7 @@ converse.plugins.add('converse-muc-views', {
case
'
topic
'
:
case
'
subject
'
:
// TODO: should be done via API call to _converse.api.rooms
_converse
.
connection
.
send
(
_converse
.
api
.
send
(
$msg
({
to
:
this
.
model
.
get
(
'
jid
'
),
from
:
_converse
.
connection
.
jid
,
...
...
src/headless/converse-chatboxes.js
View file @
7b2d64b0
...
...
@@ -346,10 +346,10 @@ converse.plugins.add('converse-chatboxes', {
},
sendMessageStanza
(
stanza
)
{
_converse
.
connection
.
send
(
stanza
);
_converse
.
api
.
send
(
stanza
);
if
(
_converse
.
forward_messages
)
{
// Forward the message, so that other connected resources are also aware of it.
_converse
.
connection
.
send
(
_converse
.
api
.
send
(
$msg
({
'
to
'
:
_converse
.
bare_jid
,
'
type
'
:
this
.
get
(
'
message_type
'
),
...
...
@@ -407,7 +407,7 @@ converse.plugins.add('converse-chatboxes', {
* See XEP-0085 Chat State Notifications.
*/
if
(
_converse
.
send_chat_state_notifications
)
{
_converse
.
connection
.
send
(
_converse
.
api
.
send
(
$msg
({
'
to
'
:
this
.
get
(
'
jid
'
),
'
type
'
:
'
chat
'
})
.
c
(
this
.
get
(
'
chat_state
'
),
{
'
xmlns
'
:
Strophe
.
NS
.
CHATSTATES
}).
up
()
.
c
(
'
no-store
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
HINTS
}).
up
()
...
...
src/headless/converse-core.js
View file @
7b2d64b0
...
...
@@ -420,7 +420,7 @@ _converse.initialize = function (settings, callback) {
*/
/* Send out a Chat Status Notification (XEP-0352) */
// XXX if (converse.features[Strophe.NS.CSI] || true) {
_converse
.
connection
.
send
(
$build
(
stat
,
{
xmlns
:
Strophe
.
NS
.
CSI
}));
_converse
.
api
.
send
(
$build
(
stat
,
{
xmlns
:
Strophe
.
NS
.
CSI
}));
_converse
.
inactive
=
(
stat
===
_converse
.
INACTIVE
)
?
true
:
false
;
};
...
...
@@ -510,7 +510,7 @@ _converse.initialize = function (settings, callback) {
*/
const
pres
=
$pres
({
to
:
jid
,
type
:
"
unsubscribed
"
});
if
(
message
&&
message
!==
""
)
{
pres
.
c
(
"
status
"
).
t
(
message
);
}
_converse
.
connection
.
send
(
pres
);
_converse
.
api
.
send
(
pres
);
};
this
.
reconnect
=
_
.
debounce
(
function
()
{
...
...
@@ -914,7 +914,7 @@ _converse.initialize = function (settings, callback) {
},
sendPresence
(
type
,
status_message
)
{
_converse
.
connection
.
send
(
this
.
constructPresence
(
type
,
status_message
));
_converse
.
api
.
send
(
this
.
constructPresence
(
type
,
status_message
));
}
});
...
...
src/headless/converse-disco.js
View file @
7b2d64b0
...
...
@@ -333,7 +333,7 @@ converse.plugins.add('converse-disco', {
_
.
each
(
plugin
.
_features
,
(
feature
)
=>
{
iqresult
.
c
(
'
feature
'
,
{
'
var
'
:
feature
}).
up
();
});
_converse
.
connection
.
send
(
iqresult
.
tree
());
_converse
.
api
.
send
(
iqresult
.
tree
());
return
true
;
}
...
...
src/headless/converse-muc.js
View file @
7b2d64b0
...
...
@@ -278,7 +278,7 @@ converse.plugins.add('converse-muc', {
stanza
.
cnode
(
Strophe
.
xmlElement
(
"
password
"
,
[],
password
));
}
this
.
save
(
'
connection_status
'
,
converse
.
ROOMSTATUS
.
CONNECTING
);
_converse
.
connection
.
send
(
stanza
);
_converse
.
api
.
send
(
stanza
);
return
this
;
},
...
...
@@ -426,7 +426,7 @@ converse.plugins.add('converse-muc', {
// <gone/> is not applicable within MUC context
return
;
}
_converse
.
connection
.
send
(
_converse
.
api
.
send
(
$msg
({
'
to
'
:
this
.
get
(
'
jid
'
),
'
type
'
:
'
groupchat
'
})
.
c
(
chat_state
,
{
'
xmlns
'
:
Strophe
.
NS
.
CHATSTATES
}).
up
()
.
c
(
'
no-store
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
HINTS
}).
up
()
...
...
@@ -462,12 +462,12 @@ converse.plugins.add('converse-muc', {
if
(
this
.
get
(
'
password
'
))
{
attrs
.
password
=
this
.
get
(
'
password
'
);
}
const
invitation
=
$msg
({
from
:
_converse
.
connection
.
jid
,
to
:
recipient
,
id
:
_converse
.
connection
.
getUniqueId
()
'
from
'
:
_converse
.
connection
.
jid
,
'
to
'
:
recipient
,
'
id
'
:
_converse
.
connection
.
getUniqueId
()
}).
c
(
'
x
'
,
attrs
);
_converse
.
connection
.
send
(
invitation
);
_converse
.
emit
(
'
roomInviteSent
'
,
{
_converse
.
api
.
send
(
invitation
);
_converse
.
api
.
emit
(
'
roomInviteSent
'
,
{
'
room
'
:
this
,
'
recipient
'
:
recipient
,
'
reason
'
:
reason
...
...
src/headless/converse-roster.js
View file @
7b2d64b0
...
...
@@ -268,7 +268,7 @@ converse.plugins.add('converse-roster', {
if
(
nick
)
{
pres
.
c
(
'
nick
'
,
{
'
xmlns
'
:
Strophe
.
NS
.
NICK
}).
t
(
nick
).
up
();
}
_converse
.
connection
.
send
(
pres
);
_converse
.
api
.
send
(
pres
);
this
.
save
(
'
ask
'
,
"
subscribe
"
);
// ask === 'subscribe' Means we have asked to subscribe to them.
return
this
;
},
...
...
@@ -279,7 +279,7 @@ converse.plugins.add('converse-roster', {
* state notification by sending a presence stanza of type
* "subscribe" to the contact
*/
_converse
.
connection
.
send
(
$pres
({
_converse
.
api
.
send
(
$pres
({
'
type
'
:
'
subscribe
'
,
'
to
'
:
this
.
get
(
'
jid
'
)
}));
...
...
@@ -294,7 +294,7 @@ converse.plugins.add('converse-roster', {
* Parameters:
* (String) jid - The Jabber ID of the user who is unsubscribing
*/
_converse
.
connection
.
send
(
$pres
({
'
type
'
:
'
unsubscribe
'
,
'
to
'
:
this
.
get
(
'
jid
'
)}));
_converse
.
api
.
send
(
$pres
({
'
type
'
:
'
unsubscribe
'
,
'
to
'
:
this
.
get
(
'
jid
'
)}));
this
.
removeFromRoster
();
this
.
destroy
();
},
...
...
@@ -317,7 +317,7 @@ converse.plugins.add('converse-roster', {
if
(
message
&&
message
!==
""
)
{
pres
.
c
(
"
status
"
).
t
(
message
);
}
_converse
.
connection
.
send
(
pres
);
_converse
.
api
.
send
(
pres
);
return
this
;
},
...
...
@@ -546,7 +546,7 @@ converse.plugins.add('converse-roster', {
// user's bare JID <user@domainpart>.
return
;
}
_converse
.
connection
.
send
(
$iq
({
type
:
'
result
'
,
id
,
from
:
_converse
.
connection
.
jid
}));
_converse
.
api
.
send
(
$iq
({
type
:
'
result
'
,
id
,
from
:
_converse
.
connection
.
jid
}));
const
query
=
sizzle
(
`query[xmlns="
${
Strophe
.
NS
.
ROSTER
}
"]`
,
iq
).
pop
();
this
.
data
.
save
(
'
version
'
,
query
.
getAttribute
(
'
ver
'
));
...
...
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