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
c4c154cf
Commit
c4c154cf
authored
Mar 02, 2018
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #1022 Include stored status message in presences.
parent
38dfc7b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletion
+29
-1
CHANGES.md
CHANGES.md
+1
-0
spec/presence.js
spec/presence.js
+27
-0
src/converse-core.js
src/converse-core.js
+1
-1
No files found.
CHANGES.md
View file @
c4c154cf
...
...
@@ -9,6 +9,7 @@
-
Avatars weren't being shown.
-
Bookmarks list and open rooms list weren't recreated after logging in for a 2nd time (without reloading the browser).
-
#1022 Status message not sent out on subsequent presences
-
#1024 null reference on MUC Invite
-
#1025 OTR lock icon disappears
-
#1027
`new Event`
not supported in IE11
...
...
spec/presence.js
View file @
c4c154cf
...
...
@@ -45,6 +45,33 @@
"
</presence>
"
);
}));
it
(
"
includes the saved status message
"
,
mock
.
initConverseWithPromises
(
null
,
[
'
rosterGroupsFetched
'
],
{},
function
(
done
,
_converse
)
{
test_utils
.
openControlBox
();
var
view
=
_converse
.
xmppstatusview
;
spyOn
(
view
.
model
,
'
sendPresence
'
).
and
.
callThrough
();
spyOn
(
_converse
.
connection
,
'
send
'
).
and
.
callThrough
();
view
.
el
.
querySelector
(
'
a.change-xmpp-status-message
'
).
click
();
var
msg
=
'
My custom status
'
;
view
.
el
.
querySelector
(
'
input.custom-xmpp-status
'
).
value
=
msg
;
view
.
el
.
querySelector
(
'
[type="submit"]
'
).
click
();
expect
(
view
.
model
.
sendPresence
).
toHaveBeenCalled
();
expect
(
_converse
.
connection
.
send
.
calls
.
mostRecent
().
args
[
0
].
toLocaleString
())
.
toBe
(
"
<presence xmlns='jabber:client'><status>My custom status</status><priority>0</priority></presence>
"
)
view
.
el
.
querySelector
(
'
a.choose-xmpp-status
'
).
click
();
view
.
el
.
querySelectorAll
(
'
.dropdown dd ul li a
'
)[
1
].
click
();
// Change status to "dnd"
expect
(
_converse
.
connection
.
send
.
calls
.
mostRecent
().
args
[
0
].
toLocaleString
())
.
toBe
(
"
<presence xmlns='jabber:client'><show>dnd</show><status>My custom status</status><priority>0</priority></presence>
"
)
done
();
}));
});
describe
(
"
A received presence stanza
"
,
function
()
{
...
...
src/converse-core.js
View file @
c4c154cf
...
...
@@ -1503,7 +1503,7 @@
constructPresence
(
type
,
status_message
)
{
let
presence
;
type
=
_
.
isString
(
type
)
?
type
:
(
this
.
get
(
'
status
'
)
||
_converse
.
default_state
);
status_message
=
_
.
isString
(
status_message
)
?
status_message
:
undefined
;
status_message
=
_
.
isString
(
status_message
)
?
status_message
:
this
.
get
(
'
status_message
'
)
;
// Most of these presence types are actually not explicitly sent,
// but I add all of them here for reference and future proofing.
if
((
type
===
'
unavailable
'
)
||
...
...
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