Commit graph

7879 commits

Author SHA1 Message Date
Reto Brunner
edb96f683b cap: type the boolean 2024-04-21 15:11:52 +02:00
Reto Brunner
5c8951ffc3 fix extractTargetGroup typing 2024-04-21 15:11:52 +02:00
Reto Brunner
c3fc54e158 ignorelist: shut up the linter 2024-04-21 15:11:52 +02:00
Reto Brunner
917fdb2a0a ignore: remove dead import 2024-04-21 15:11:52 +02:00
Reto Brunner
b8400a3a46 ignore: clean up the types and conditionals
Now that ignorelist doesn't muddy the waters, we can clean up
all the funny conditional types and enforce `when`
2024-04-21 15:11:52 +02:00
Reto Brunner
071a5afda6 ignore: move ignorelist to its own command
ignorelist shares no logic with /ignore or /unignore so it shouldn't
share a file. That just makes typing awkward.
2024-04-21 15:11:52 +02:00
Reto Brunner
5274fdc21a ignore: keep happy path on the left
It is much easier to follow the control flow if error checks
are done on the indented path, immediately returning.
2024-04-21 15:11:52 +02:00
Reto Brunner
b8a9fe08ab clientCertificate: remove unsafe casts 2024-04-21 15:11:52 +02:00
Reto Brunner
a4afa08add ldap: type SearchOptions scope 2024-04-21 15:11:52 +02:00
Reto Brunner
4614c35486 chan: type untyped method params 2024-04-21 15:11:52 +02:00
Reto Brunner
540144c417 chan: remove cast in pushMessage 2024-04-21 15:11:52 +02:00
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