Commit graph

7868 commits

Author SHA1 Message Date
Reto Brunner
bb7c3925c6 type serverOptions for network:options 2024-04-21 15:11:52 +02:00
Reto Brunner
9898f38de6 add todo 2024-04-21 15:11:52 +02:00
Reto Brunner
9f2c82e152 fix mentions 2024-04-21 15:11:52 +02:00
Reto Brunner
17ba07db3b fix mentions import 2024-04-21 15:11:52 +02:00
Reto Brunner
0311e5f836 add socket-events import to entry point
socket-events aren't ever imported, if we don't do that however
webpack never actually sees any code that leads to it and skips
bundling it.

So for now, do an import that has the side effect of registering
all the events until we have a proper registration in place that's
a bit more sane to call
2024-04-21 15:11:52 +02:00
Reto Brunner
4d0474b897 store: don't duplicate import 2024-04-21 15:11:52 +02:00
Reto Brunner
14b9169899 store: fix import 2024-04-21 15:11:52 +02:00
Reto Brunner
50037644c0 socket-events: fix join 2024-04-21 15:11:52 +02:00
Reto Brunner
7287c6bcaa remove dead import 2024-04-21 15:11:52 +02:00
Reto Brunner
bfca0ca612 fix more 2024-04-21 15:11:52 +02:00
Reto Brunner
300bd4c84c add timestamp to NotificationOptions 2024-04-21 15:11:52 +02:00
Reto Brunner
42ea66c343 socket-events/msg: fix errors 2024-04-21 15:11:51 +02:00
Reto Brunner
1565eb8d05 socket-events/msg: if/else chains are not a switch replacement
If we switch on a field, use switch for god's sake.
If/elif chains are for cases where you have multiple selectors.
2024-04-21 15:11:51 +02:00
Reto Brunner
29750a3e51 ClientChan: does need a user array after all 2024-04-21 15:11:51 +02:00
Reto Brunner
3ea5170e6a socket-events: fix network:status 2024-04-21 15:11:51 +02:00
Reto Brunner
fe4f497fad fix socket-event: network 2024-04-21 15:11:51 +02:00
Reto Brunner
c20cd6bda1 publicClient: add FIXME and ignore the type mismatch
The publicClient interface is utterly horrific.
It allows any client to inject arbitrary events into the socket.io
event stream.
This should get wrapped into a "plugin" event so that it can get properly
typed, better yet, this should get removed completely.
2024-04-21 15:11:51 +02:00
Reto Brunner
1c4ce5d4a5 fix sync_sort:channels emitter 2024-04-21 15:11:51 +02:00
Reto Brunner
9c4d24d1f7 fix join socket type 2024-04-21 15:11:51 +02:00
Reto Brunner
35e38d13c4 client: properly type the emit method
This breaks the world -.-
2024-04-21 15:11:51 +02:00
Reto Brunner
bf7eb0e727 network event: remove unused array
All the network events only ever emit a single copy
There's no point in wrapping it into an array
2024-04-21 15:11:51 +02:00
Reto Brunner
5ee9c2b338 type Server 2024-04-21 15:11:51 +02:00
Reto Brunner
e15b121080 remove obsolete error override 2024-04-21 15:11:51 +02:00
Reto Brunner
98452ccc18 remove obsolete import 2024-04-21 15:11:51 +02:00
Reto Brunner
a8e7022d04 fix search event params 2024-04-21 15:11:51 +02:00
Reto Brunner
60486bf5e3 server: fix init client 2024-04-21 15:11:51 +02:00
Reto Brunner
46f3fd9682 server: fix push subscription 2024-04-21 15:11:51 +02:00
Reto Brunner
56215382a3 server: remove static props which are currently unused 2024-04-21 15:11:51 +02:00
Reto Brunner
9ab9ad0f56 socket-events: fix up init 2024-04-21 15:11:51 +02:00
Reto Brunner
0660a8772c server: fix getFilteredClone of chan 2024-04-21 15:11:51 +02:00
Reto Brunner
f5c691f37b wip: unbork init progress 2024-04-21 15:11:51 +02:00
Reto Brunner
0067c30273 Split sort event
The sort event bundled networks and channels for no reason at all.
They share none of the actual logic, so combining them just makes
the typing poor but serves no benefit.
2024-04-21 15:11:51 +02:00
Reto Brunner
843db1727b server: actually type the socket 2024-04-21 15:11:51 +02:00
Reto Brunner
e9ef59b641 fix bad typing
There were quite some errors, where the type was passed the wrong way
```
// This is invalid
"change-password": ({ old_password: string, new_password: string, verify_password: string})

// What was actually meant
"change-password": (data: { old_password: string, new_password: string, verify_password: string})
```

The whole callback function is also very verbose as is, with fluff we don't need.
It's always a function that returns void, so there's no real information to be gained
by spelling it out time and time again.

Let's use a helper type that just accepts the payload.
That should make the above error impossible to do.
2024-04-21 15:11:51 +02:00
Reto Brunner
fceffd42b9 fix missing import 2024-04-21 15:11:51 +02:00
Reto Brunner
b89b0cad53 client: id is always a string, not a number 2024-04-21 15:11:51 +02:00
Reto Brunner
c869ea9a73 sharedchans does not have users 2024-04-21 15:11:51 +02:00
Reto Brunner
9aee3e3e98 Some whitespace is good mkey 2024-04-21 15:11:51 +02:00
Reto Brunner
636b5c5b04 models/network: unfuck client export 2024-04-21 15:11:51 +02:00
Reto Brunner
6984e8f25a unused import 2024-04-21 15:11:51 +02:00
Reto Brunner
e43cbb139c remove all server files from compilation 2024-04-21 15:11:51 +02:00
Reto Brunner
e57e547b74 further chan fixes 2024-04-21 15:11:51 +02:00
Reto Brunner
3217536245 searchresponse 2024-04-21 15:11:51 +02:00
Reto Brunner
194b4e1a2f import fix 2024-04-21 15:11:51 +02:00
Reto Brunner
88c8830a17 chatuserlist 2024-04-21 15:11:51 +02:00
Reto Brunner
7073584f1c fix msg event 2024-04-21 15:11:51 +02:00
Reto Brunner
8e6920af1d configuration 2024-04-21 15:11:51 +02:00
Reto Brunner
7bc184b252 changelog data type 2024-04-21 15:11:51 +02:00
Reto Brunner
4d237600d5 changelog: don't type assert to a broken type
The mandatory fields are unset, stop lying to the compiler
2024-04-21 15:11:51 +02:00
Reto Brunner
383907c2b8 Use SharedTypes 2024-04-21 15:10:45 +02:00