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.5.4...v0.5.5
Source
v0.5.5
Select Git revision
...
Target
v0.5.4
Select Git revision
Compare
Commits (1)
fix: context
· 0379d31b
Jean-Baptiste Pasquier
authored
Feb 28, 2020
0379d31b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
sib-chat.js
sib-chat.js
+7
-4
No files found.
sib-chat.js
View file @
0379d31b
...
...
@@ -5,7 +5,6 @@ import { Sib } from "https://unpkg.com/@startinblox/core@0.9/dist/libs/Sib.js";
import
{
StoreMixin
}
from
'
https://unpkg.com/@startinblox/core@0.9/dist/mixins/storeMixin.js
'
;
Helpers
.
importCSS
(
'
https://unpkg.com/converse.js@4.2/css/fonts.css
'
);
const
jabberIDContext
=
{
"
foaf
"
:
'
http://xmlns.com/foaf/0.1/
'
,
"
chatProfile
"
:
"
http://happy-dev.fr/owl/#chatProfile
"
,
"
jabberID
"
:
"
foaf:jabberID
"
};
class
Deferred
{
constructor
()
{
...
...
@@ -39,6 +38,10 @@ export const SibChat = {
},
},
get
context
()
{
return
{
"
foaf
"
:
'
http://xmlns.com/foaf/0.1/
'
,
"
chatProfile
"
:
"
http://happy-dev.fr/owl/#chatProfile
"
,
"
jabberID
"
:
"
foaf:jabberID
"
};
},
async
created
()
{
const
check_identified
=
await
document
.
querySelector
(
'
sib-auth
'
).
getUserIdToken
();
if
(
check_identified
)
{
...
...
@@ -65,7 +68,7 @@ export const SibChat = {
if
(
await
this
.
resource
.
jabberRoom
)
{
this
.
jid
=
(
await
this
.
resource
[
'
foaf:jabberID
'
]);
}
else
{
await
store
.
initGraph
(
this
.
resource
[
'
@id
'
],
jabberIDC
ontext
);
await
store
.
initGraph
(
this
.
resource
[
'
@id
'
],
this
.
c
ontext
);
this
.
jid
=
await
(
store
.
get
(
this
.
resource
[
'
@id
'
])[
'
chatProfile.jabberID
'
]);
}
await
converse_sib
.
connected_deferred
...
...
@@ -161,14 +164,14 @@ export const SibChat = {
});
let
user
=
await
document
.
querySelector
(
'
sib-auth
'
).
getUser
();
await
store
.
initGraph
(
user
[
'
@id
'
],
jabberIDC
ontext
);
await
store
.
initGraph
(
user
[
'
@id
'
],
this
.
c
ontext
);
const
jabberID
=
await
(
store
.
get
(
user
[
'
@id
'
])[
'
chatProfile.jabberID
'
]);
if
(
this
.
resource
)
{
if
(
await
this
.
resource
.
jabberRoom
)
{
this
.
jid
=
(
await
this
.
resource
[
'
foaf:jabberID
'
]);
}
else
{
await
store
.
initGraph
(
this
.
resource
[
'
@id
'
],
jabberIDC
ontext
);
await
store
.
initGraph
(
this
.
resource
[
'
@id
'
],
this
.
c
ontext
);
this
.
jid
=
(
await
(
store
.
get
(
this
.
resource
[
'
@id
'
])[
'
chatProfile.jabberID
'
]));
}
}
else
{
...
...