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
f7ef334f
Commit
f7ef334f
authored
Aug 18, 2020
by
JC Brand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename method to better describe what it does
parent
7cbb1b23
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
spec/controlbox.js
spec/controlbox.js
+2
-2
spec/muclist.js
spec/muclist.js
+2
-2
src/headless/converse-chat.js
src/headless/converse-chat.js
+2
-2
src/headless/converse-muc.js
src/headless/converse-muc.js
+3
-3
No files found.
spec/controlbox.js
View file @
f7ef334f
...
@@ -89,7 +89,7 @@ describe("The Controlbox", function () {
...
@@ -89,7 +89,7 @@ describe("The Controlbox", function () {
.
c
(
'
active
'
,
{
'
xmlns
'
:
'
http://jabber.org/protocol/chatstates
'
}).
tree
();
.
c
(
'
active
'
,
{
'
xmlns
'
:
'
http://jabber.org/protocol/chatstates
'
}).
tree
();
_converse
.
handleMessageStanza
(
msg
);
_converse
.
handleMessageStanza
(
msg
);
await
u
.
waitUntil
(()
=>
_converse
.
rosterview
.
el
.
querySelectorAll
(
"
.msgs-indicator
"
).
length
);
await
u
.
waitUntil
(()
=>
_converse
.
rosterview
.
el
.
querySelectorAll
(
"
.msgs-indicator
"
).
length
);
spyOn
(
chatview
.
model
,
'
incrementUnreadMsgCounter
'
).
and
.
callThrough
();
spyOn
(
chatview
.
model
,
'
handleUnreadMessage
'
).
and
.
callThrough
();
await
u
.
waitUntil
(()
=>
_converse
.
chatboxviews
.
el
.
querySelector
(
'
.restore-chat .message-count
'
)?.
textContent
===
'
1
'
);
await
u
.
waitUntil
(()
=>
_converse
.
chatboxviews
.
el
.
querySelector
(
'
.restore-chat .message-count
'
)?.
textContent
===
'
1
'
);
expect
(
_converse
.
rosterview
.
el
.
querySelector
(
'
.msgs-indicator
'
).
textContent
).
toBe
(
'
1
'
);
expect
(
_converse
.
rosterview
.
el
.
querySelector
(
'
.msgs-indicator
'
).
textContent
).
toBe
(
'
1
'
);
...
@@ -101,7 +101,7 @@ describe("The Controlbox", function () {
...
@@ -101,7 +101,7 @@ describe("The Controlbox", function () {
}).
c
(
'
body
'
).
t
(
'
hello again
'
).
up
()
}).
c
(
'
body
'
).
t
(
'
hello again
'
).
up
()
.
c
(
'
active
'
,
{
'
xmlns
'
:
'
http://jabber.org/protocol/chatstates
'
}).
tree
();
.
c
(
'
active
'
,
{
'
xmlns
'
:
'
http://jabber.org/protocol/chatstates
'
}).
tree
();
_converse
.
handleMessageStanza
(
msg
);
_converse
.
handleMessageStanza
(
msg
);
await
u
.
waitUntil
(()
=>
chatview
.
model
.
incrementUnreadMsgCounter
.
calls
.
count
());
await
u
.
waitUntil
(()
=>
chatview
.
model
.
handleUnreadMessage
.
calls
.
count
());
await
u
.
waitUntil
(()
=>
_converse
.
chatboxviews
.
el
.
querySelector
(
'
.restore-chat .message-count
'
)?.
textContent
===
'
2
'
);
await
u
.
waitUntil
(()
=>
_converse
.
chatboxviews
.
el
.
querySelector
(
'
.restore-chat .message-count
'
)?.
textContent
===
'
2
'
);
expect
(
_converse
.
rosterview
.
el
.
querySelector
(
'
.msgs-indicator
'
).
textContent
).
toBe
(
'
2
'
);
expect
(
_converse
.
rosterview
.
el
.
querySelector
(
'
.msgs-indicator
'
).
textContent
).
toBe
(
'
2
'
);
chatview
.
model
.
set
({
'
minimized
'
:
false
});
chatview
.
model
.
set
({
'
minimized
'
:
false
});
...
...
spec/muclist.js
View file @
f7ef334f
...
@@ -315,7 +315,7 @@ describe("A groupchat shown in the groupchats list", function () {
...
@@ -315,7 +315,7 @@ describe("A groupchat shown in the groupchats list", function () {
let
indicator_el
=
await
u
.
waitUntil
(()
=>
lview
.
el
.
querySelector
(
"
.msgs-indicator
"
));
let
indicator_el
=
await
u
.
waitUntil
(()
=>
lview
.
el
.
querySelector
(
"
.msgs-indicator
"
));
expect
(
indicator_el
.
textContent
).
toBe
(
'
1
'
);
expect
(
indicator_el
.
textContent
).
toBe
(
'
1
'
);
spyOn
(
view
.
model
,
'
incrementUnreadMsgCounter
'
).
and
.
callThrough
();
spyOn
(
view
.
model
,
'
handleUnreadMessage
'
).
and
.
callThrough
();
await
view
.
model
.
handleMessageStanza
(
await
view
.
model
.
handleMessageStanza
(
$msg
({
$msg
({
from
:
room_jid
+
'
/
'
+
nick
,
from
:
room_jid
+
'
/
'
+
nick
,
...
@@ -324,7 +324,7 @@ describe("A groupchat shown in the groupchats list", function () {
...
@@ -324,7 +324,7 @@ describe("A groupchat shown in the groupchats list", function () {
type
:
'
groupchat
'
type
:
'
groupchat
'
}).
c
(
'
body
'
).
t
(
'
romeo: and another thing...
'
).
tree
()
}).
c
(
'
body
'
).
t
(
'
romeo: and another thing...
'
).
tree
()
);
);
await
u
.
waitUntil
(()
=>
view
.
model
.
incrementUnreadMsgCounter
.
calls
.
count
());
await
u
.
waitUntil
(()
=>
view
.
model
.
handleUnreadMessage
.
calls
.
count
());
await
u
.
waitUntil
(()
=>
lview
.
el
.
querySelector
(
"
.msgs-indicator
"
).
textContent
===
'
2
'
,
1000
);
await
u
.
waitUntil
(()
=>
lview
.
el
.
querySelector
(
"
.msgs-indicator
"
).
textContent
===
'
2
'
,
1000
);
// When the chat gets maximized again, the unread indicators are removed
// When the chat gets maximized again, the unread indicators are removed
...
...
src/headless/converse-chat.js
View file @
f7ef334f
...
@@ -475,7 +475,7 @@ converse.plugins.add('converse-chat', {
...
@@ -475,7 +475,7 @@ converse.plugins.add('converse-chat', {
if
(
u
.
shouldCreateMessage
(
attrs
))
{
if
(
u
.
shouldCreateMessage
(
attrs
))
{
const
msg
=
this
.
handleCorrection
(
attrs
)
||
await
this
.
createMessage
(
attrs
);
const
msg
=
this
.
handleCorrection
(
attrs
)
||
await
this
.
createMessage
(
attrs
);
this
.
notifications
.
set
({
'
chat_state
'
:
null
});
this
.
notifications
.
set
({
'
chat_state
'
:
null
});
this
.
incrementUnreadMsgCounter
(
msg
);
this
.
handleUnreadMessage
(
msg
);
}
}
}
}
},
},
...
@@ -1154,7 +1154,7 @@ converse.plugins.add('converse-chat', {
...
@@ -1154,7 +1154,7 @@ converse.plugins.add('converse-chat', {
* @private
* @private
* @param {_converse.Message} message
* @param {_converse.Message} message
*/
*/
incrementUnreadMsgCounter
(
message
)
{
handleUnreadMessage
(
message
)
{
if
(
!
message
?.
get
(
'
body
'
))
{
if
(
!
message
?.
get
(
'
body
'
))
{
return
return
}
}
...
...
src/headless/converse-muc.js
View file @
f7ef334f
...
@@ -2014,7 +2014,7 @@ converse.plugins.add('converse-muc', {
...
@@ -2014,7 +2014,7 @@ converse.plugins.add('converse-muc', {
if
(
u
.
shouldCreateGroupchatMessage
(
attrs
))
{
if
(
u
.
shouldCreateGroupchatMessage
(
attrs
))
{
const
msg
=
this
.
handleCorrection
(
attrs
)
||
await
this
.
createMessage
(
attrs
);
const
msg
=
this
.
handleCorrection
(
attrs
)
||
await
this
.
createMessage
(
attrs
);
this
.
removeNotification
(
attrs
.
nick
,
[
'
composing
'
,
'
paused
'
]);
this
.
removeNotification
(
attrs
.
nick
,
[
'
composing
'
,
'
paused
'
]);
this
.
incrementUnreadMsgCounter
(
msg
);
this
.
handleUnreadMessage
(
msg
);
}
}
},
},
...
@@ -2402,10 +2402,10 @@ converse.plugins.add('converse-muc', {
...
@@ -2402,10 +2402,10 @@ converse.plugins.add('converse-muc', {
/* Given a newly received message, update the unread counter if necessary.
/* Given a newly received message, update the unread counter if necessary.
* @private
* @private
* @method _converse.ChatRoom#
incrementUnreadMsgCounter
* @method _converse.ChatRoom#
handleUnreadMessage
* @param { XMLElement } - The <messsage> stanza
* @param { XMLElement } - The <messsage> stanza
*/
*/
incrementUnreadMsgCounter
(
message
)
{
handleUnreadMessage
(
message
)
{
if
(
!
message
?.
get
(
'
body
'
))
{
if
(
!
message
?.
get
(
'
body
'
))
{
return
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