@cocreate/socket-server 1.20.0 → 1.20.2
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/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/src/index.js +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.20.2](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.20.1...v1.20.2) (2023-10-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* added more methods to the message_log if condition ([37f1106](https://github.com/CoCreate-app/CoCreate-socket-server/commit/37f1106efc30c1278aded8462d779c70e18f28f4))
|
|
7
|
+
|
|
8
|
+
## [1.20.1](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.20.0...v1.20.1) (2023-10-19)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* do not log updateUserStatus ([f98961b](https://github.com/CoCreate-app/CoCreate-socket-server/commit/f98961b91106ea34b3afeefdafbfcc1dffca095e))
|
|
14
|
+
|
|
1
15
|
# [1.20.0](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.19.5...v1.20.0) (2023-10-19)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -86,14 +86,16 @@ class SocketServer extends EventEmitter {
|
|
|
86
86
|
|
|
87
87
|
if (self.authenticate) {
|
|
88
88
|
const { user_id, expires } = self.authenticate.decodeToken(options.token)
|
|
89
|
-
|
|
89
|
+
const userStatus = { socket, method: 'userStatus', user_id: options.user_id, userStatus: 'off', organization_id }
|
|
90
90
|
if (user_id) {
|
|
91
|
+
options.user_id = user_id
|
|
91
92
|
socket.user_id = user_id;
|
|
92
93
|
socket.expires = expires;
|
|
93
|
-
|
|
94
|
+
userStatus.userStatus = 'on'
|
|
94
95
|
self.emit("notification.user", socket)
|
|
95
|
-
}
|
|
96
|
-
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
self.emit('userStatus', userStatus);
|
|
97
99
|
|
|
98
100
|
self.onWebSocket(socket);
|
|
99
101
|
|
|
@@ -419,7 +421,7 @@ class SocketServer extends EventEmitter {
|
|
|
419
421
|
if (authorized && authorized.authorized)
|
|
420
422
|
data = authorized.authorized
|
|
421
423
|
|
|
422
|
-
if (!data.method.startsWith('read.')
|
|
424
|
+
if (!data.method.startsWith('read.') && data.method !== 'updateUserStatus' && data.method !== 'userStatus' && data.method !== 'signIn' && data.method !== 'signUp') {
|
|
423
425
|
let object = { url: socket.socketUrl, data }
|
|
424
426
|
delete object.socket
|
|
425
427
|
this.emit('create.object', {
|