u-wave-announce 0.6.0-alpha.2 → 0.6.0-alpha.3

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/plugin.js +6 -4
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "u-wave-announce",
3
3
  "description": "Announce your üWave server's existence to the world.",
4
- "version": "0.6.0-alpha.2",
4
+ "version": "0.6.0-alpha.3",
5
5
  "author": "Renée Kooi <renee@kooi.me>",
6
6
  "type": "module",
7
7
  "dependencies": {
8
- "libsodium-wrappers": "^0.8.0",
8
+ "libsodium-wrappers": "^0.8.4",
9
9
  "node-fetch": "^3.3.1",
10
10
  "strip-indent": "^4.0.0"
11
11
  },
package/src/plugin.js CHANGED
@@ -91,11 +91,13 @@ async function getAnnounceData(uw, options) {
91
91
 
92
92
  const entry = await uw.booth.getCurrentEntry();
93
93
 
94
- // TODO add something to üWave Core so we don't have to manually ask Redis for
95
- // this information. Currently üWave Core may register duplicates in this
96
- // list, too, which is a bit annoying!
94
+ // TODO add something to üWave Core so we don't have to manually ask
95
+ // Redis/SQLite for this information. Currently üWave Core may register
96
+ // duplicates in this list, too, which is a bit annoying!
97
97
  // TODO add guest users here too.
98
- const onlineUserIDs = await uw.redis.lrange('users', 0, -1);
98
+ const onlineUserIDs = uw.redis
99
+ ? await uw.redis.lrange('users', 0, -1)
100
+ : await uw.keyv.get('users');
99
101
  const usersCount = new Set(onlineUserIDs).size;
100
102
 
101
103
  return {