@live-change/peer-connection-service 0.8.110 → 0.8.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/message.js +14 -10
- package/package.json +2 -2
package/message.js
CHANGED
|
@@ -43,13 +43,16 @@ const Message = definition.model({
|
|
|
43
43
|
property: ['to', 'timestamp']
|
|
44
44
|
},*/
|
|
45
45
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
definition.event({
|
|
49
|
+
name: "MessageCreated",
|
|
50
|
+
async execute({ message, data }, { client, service }) {
|
|
51
|
+
if(data.id) delete data.id
|
|
52
|
+
await Message.create({
|
|
53
|
+
id: message,
|
|
54
|
+
...data
|
|
55
|
+
})
|
|
53
56
|
}
|
|
54
57
|
})
|
|
55
58
|
|
|
@@ -154,15 +157,16 @@ definition.action({
|
|
|
154
157
|
if(visibilityTest) return true
|
|
155
158
|
const [fromType, fromId, fromSession] = from.split(':')
|
|
156
159
|
const [toType, toId, toSession] = to.split(':')
|
|
157
|
-
console.log("POST MESSAGE", fromType, fromId, fromSession, '=>', toType, toId, toSession, "BY", client)
|
|
160
|
+
//console.log("POST MESSAGE", fromType, fromId, fromSession, '=>', toType, toId, toSession, "BY", client)
|
|
158
161
|
if(toType !== fromType || toId !== fromId) return false // different channel
|
|
159
162
|
if(client.session !== fromSession) return false
|
|
160
163
|
const hasRole = await clientHasAccessRoles(client, { objectType: toType, object: toId }, writerRoles)
|
|
161
164
|
return hasRole
|
|
162
165
|
},
|
|
163
|
-
queuedBy: (props) => props.to, // without this, messages order can be changed
|
|
166
|
+
queuedBy: (props) => props.from+':'+props.to, // without this, messages order can be changed
|
|
167
|
+
// and it will block ice connection state
|
|
164
168
|
async execute(props, { client, service }, emit) {
|
|
165
|
-
|
|
169
|
+
console.error('postMessage is deprecated, use postMessages instead')
|
|
166
170
|
const result = postMessage(props, { client, service }, emit)
|
|
167
171
|
console.log("MESSAGE POSTED!")
|
|
168
172
|
return result
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/peer-connection-service",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.111",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
},
|
|
12
12
|
"author": "Michał Łaszczewski <michal@emikse.com>",
|
|
13
13
|
"license": "BSD-3-Clause",
|
|
14
|
-
"gitHead": "
|
|
14
|
+
"gitHead": "9b96afb2fc61ab3d2a5d143924e2c56d411280b4"
|
|
15
15
|
}
|