Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SiB Chat
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
51
Issues
51
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Startin blox
components
SiB Chat
Compare Revisions
v0.3.9...v0.3.10
Source
v0.3.10
Select Git revision
...
Target
v0.3.9
Select Git revision
Compare
Commits (1)
update: read event on chatbox focus
· a1806b70
Jean-Baptiste Pasquier
authored
Oct 02, 2019
a1806b70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
sib-chat.js
sib-chat.js
+22
-3
No files found.
sib-chat.js
View file @
a1806b70
...
...
@@ -112,7 +112,8 @@ export const SibChat = {
jid
=
jid
.
toLowerCase
();
this
.
_converse
.
root
=
root
;
const
converse_el
=
[...
document
.
querySelectorAll
(
'
sib-chat
'
)]
// Get the current used sib-chat
const
converse_el
=
Array
.
from
(
document
.
querySelectorAll
(
'
sib-chat
'
))
.
map
(
el
=>
el
.
shadowRoot
.
getElementById
(
'
conversejs
'
))
.
filter
(
el
=>
el
)
.
pop
();
...
...
@@ -140,7 +141,7 @@ export const SibChat = {
this
.
_converse
.
api
.
chats
.
open
(
jid
);
}
}
})
})
;
// Initialize change change plugin
converse
.
plugins
.
add
(
'
conversejs-changechat
'
,
converse_sib
.
service
.
plugins
.
sibChat
);
...
...
@@ -151,6 +152,24 @@ export const SibChat = {
}
});
// Initialize deferred resolution plugin
converse
.
plugins
.
add
(
'
conversejs-sib-focused
'
,
{
initialize
()
{
this
.
_converse
.
api
.
listen
.
on
(
'
chatBoxFocused
'
,
function
()
{
// Get the currently used sib-chat & send read event of
const
resource
=
Array
.
from
(
document
.
querySelectorAll
(
'
sib-chat
'
))
.
filter
(
el
=>
{
return
el
.
shadowRoot
.
getElementById
(
'
conversejs
'
)})
.
pop
()
.
_component
.
resource
;
window
.
dispatchEvent
(
new
CustomEvent
(
'
read
'
,
{
detail
:
{
resource
:
resource
}
}));
});
}
});
let
user
=
await
document
.
querySelector
(
'
sib-auth
'
).
getUser
();
user
=
await
store
.
get
(
user
);
...
...
@@ -208,7 +227,7 @@ export const SibChat = {
fileupload
:
false
,
toggle_occupants
:
false
},
'
whitelisted_plugins
'
:
[
'
conversejs-sib-connected
'
,
'
conversejs-changechat
'
],
'
whitelisted_plugins
'
:
[
'
conversejs-sib-connected
'
,
'
conversejs-
sib-focused
'
,
'
conversejs-
changechat
'
],
});
converse_sib
.
loaded_deferred
.
resolve
();
...
...