Commit Graph

122 Commits

Author SHA1 Message Date
shockrah
25692b6b92 * UserConfig now stores no numbers(all strings)
This is to avoid type coercion and loss of precision
2021-09-23 10:31:59 -07:00
shockrah
68198cd300 * Fixing EventEmitter import
+ More safety checks in Cache.update_channels
2021-09-23 10:31:19 -07:00
shockrah
3472e4d7c7 - Removing unused code
* Fixing issue with json integers being mis represented
2021-09-23 10:30:41 -07:00
shockrah
be0dc39042 + Tsconfig with some semi strict rules
Keeping the config lenient for now because more changes have to happen first
2021-09-23 10:30:08 -07:00
shockrah
33b8bcd180 * Updating tslib and wslib 2021-09-23 10:29:31 -07:00
shockrah
32eb669f96 * messages.recent_messages now uses the /message/recent
This should be more clear in its intentions and basically gives the behavior
you expect when looking at this method
2021-04-27 13:40:12 -07:00
shockrah
591e993329 + Adding cache handler for adding lots of messages from one server call
+ Better error logging in cache

! There is still lots of debug logs which at some point need to be built _out_ from prod builds
Also I need some prod builds

+ Adding more return type annotations for clarity/docs sake

- Removed ancient docs in messages module as they were basically just straight up wrong
2021-04-15 19:57:13 -07:00
shockrah
68e22e1b38 - removing uninportant things
+ messages module was for some reason still using legacy url generation(fixed that)
+ switching types to use bigint since everything is u64/i64 on the backend
2021-04-14 23:00:39 -07:00
shockrah
40351f934e + New cache ipc handlers for adding server caches
Interface for this is fiddly and probably requires real docs to be further developed
without losing my mind doc the whole cache at some point
+ New cache ipc handlers for adding a new open web socket
Web socket comes with some basic listeners, however very litte/nothing
is being done check the health of these connections or to try when possible.

+ Cache now adds actual message objects to its message arrays instead of raw strings (wew)
+ Events module has been added to move the parsing logic/validation away from everything else

+ The basic Event structure has some niftier-than-you-think behavior for data acccess which the cache can leverage for more concise+ correct behavior
2021-04-14 23:00:26 -07:00
shockrah
01c245cbba Ignoring more compiled js and building new events module 2021-04-14 22:48:41 -07:00
shockrah
42d6a77050 - Removing network control from the cache
From this point forward the cache should basically just be a data container.
Methods on the cache object are there for convenience and should only ever
return very simple data [booleans, integers, () etc.].
The cache should also have very litter/no concept of commands to decouple it
from the renderer process.
! list_channels is still implemented in the cache however it remaains a vestige
and will be moved to the net module

Also the client is getting some new packages for websocket connections and
while they work some additional work has to be put in to figure out where fug to
actually place the websocket so that it can update the cache+DOM in a seomewhat sensible fashion
2021-04-11 17:39:54 -07:00
shockrah
102c3b2a10 Electron on Linux hangs when making two successive async calls over the network
Without this calls to /channels/list would break after the first API hit
2021-04-10 17:09:25 -07:00
shockrah
72f3461341 ! Due to user-id's being randomly generated it is now much more likely that id's can't be parsed by javascript properly
Json-bigint should help alleviate this issue by correctly parsing numbers for us

- Removing url method in favor of new url property in server config model

+ Building UserConfigs and ServerConfig from typical JS Obects
This should reduce some up front complexity regarding parameters

! Fix: using new url property instead of protocol + host + port

- Reducing upfront complexity of public channels API
* Also moving to using new updated server.url property
* Channels also handles its part of updating the dom now

bigint parsing in configs now

* More switches to server.url property
2021-04-10 17:09:21 -07:00
shockrah
fe448d07d4 Better naming scheme for when we start requesting voice channels after this 2021-04-07 22:17:28 -07:00
shockrah
498da4c899 Updating dependancies to latest versions and removing some fluff interim libs 2021-03-30 22:49:20 -07:00
shockrah
8812ff7198 + text/plain Message sending works now
+ More skeleton code for the caching system

! Ready for rtc on text based message listening which is where heavy caching comes into play
2021-03-20 19:35:38 -07:00
shockrah
c3d5c75cc0 messages rebind now work properly and sends message correctly,
Message constructor no longer incorrectly check message type
2021-03-12 23:16:06 -08:00
shockrah
c667f69d0e Fixing busted config adder thingy 2021-03-12 21:36:44 -08:00
shockrah
67575cda53 adding tsc to make build 2021-03-12 02:20:33 -08:00
shockrah
5b2e92da06 Caching is still being designed but it _will_ be written in typescript to a more well docc'ed api for everything else
+ Basically im doing this to straight up abuse
- Moving cache types + methods to their own module
2021-03-12 02:20:00 -08:00
shockrah
dc117ba02f Moving message type to types.ts 2021-03-11 17:22:22 -08:00
shockrah
d620d3cc61 New types module written with typescript to slowly start migrating code over to typescript
The main reason for this change is for writing more descriptive code
Such a change isn't impossible with JS but requires annoying doccing that  most dev environments don't really pick up on ever

Also the cache system is goingto be much more complex than anything else in this project so static compilation should help remove annoyances
2021-03-11 17:22:05 -08:00
shockrah
049e8aea82 Misc fixes
- I've no idea how to describe these but they're really not that important
2021-03-11 17:20:13 -08:00
shockrah
e4f6e71ac8 ! Fixing message box to look decent
- Moving Initialization code into src/init.js
2021-03-11 17:18:26 -08:00
shockrah
b5822cd3f1 Moving as much auth/initialization logic out of index.html
 New local push function in auth for push server buttons onto the dom
2021-03-09 15:36:55 -08:00
shockrah
911edd8114 Supporting content_type flag in messages properly now 2021-03-09 00:11:34 -08:00
shockrah
2fa1ec6f34 Async rewrite of entire module !
 Channels list now fully asynchronous
 html pusher is now its own function for cleanness
 New ANY_CHANNEL integer is supported by the backend for requesting all channels in one go instead of voice|text
 Removed more callback hell code
 JSDocs updated to reflect their respective function signatures
2021-03-09 00:10:59 -08:00
shockrah
7fede3b4e1 New css making channel buttons not ugly as hell
 Moving channels.list behind async call
 Moved server-name to top of dom to reduce clutter(i think)
2021-03-09 00:07:41 -08:00
shockrah
d8244388c2 Removing myself from callback hell slowly but surely
 Removing ipc calls reducing chance to shrek the drive
2021-03-08 19:53:14 -08:00
shockrah
ef0bc70f90 Complexity in auth.login by basically cutting it in half and throwing the bad half out
 auth.init is now the more complex site since it literally has 1 chance to fire
2021-03-08 19:51:57 -08:00
shockrah
c4e3fa72ce More comprehensive example user config
 Moving main.js to use more async code and make things a bit more homogeneous
2021-03-08 19:50:01 -08:00
shockrah
f14390f4bb Callback settings.add_server_to_config now in effect for people that don't want to fuck with config files 2021-03-07 23:54:57 -08:00
shockrah
0d888a4c63 More unused code that pull credentials out of an object
Like why was this here, it's literally just object[key_name]
2021-03-07 23:54:17 -08:00
shockrah
6cfb7e7e4d No more callback trickery with auth.init
 Even more fluff removed
 From this point forward the codebase is mature enough for slimming down fearlessly
2021-03-07 23:53:09 -08:00
shockrah
7d3325fdc6 ipcMain now uses handle instead of .on for
 config-request probably doesn't need to be async like at all
2021-03-07 23:51:51 -08:00
shockrah
ca68c61f3a Framework/Modal for settings coming together
 Changing inline script to now run in an async block
 No more callback hell, literally anything can be written with async/await or callbacks when appropos
2021-03-07 23:49:49 -08:00
shockrah
fd1bf41fec Message constructor now takes in username as a parameter and binds it to uname
 Removed some fluff
 New get_member endpoint handler for later
2021-03-07 13:50:48 -08:00
shockrah
784043fc89 Cleaned up channels list header/description
 Better scrollarea definition for messages area
 Logging http errors in catch statement on auth init
2021-03-07 13:47:41 -08:00
shockrah
8e6c90b3c4 Removing superflous css in some jquery
 Messages now has its own properly named type exposed for other modules to use if it's required
 New jquery calls in messages to actually populate the message box with the last 48 hours worth of messages
2021-03-05 17:48:59 -08:00
shockrah
231141221b Adding hooks to reqest channel messages
 DOM manipulation for channel buttons moved to new module
 Message hooks themselves still require actual implementation but
all the required fallbacks are there
2021-03-03 21:49:40 -08:00
shockrah
9bf4048313 Removing a bunch of bs that is no longer used 2021-03-03 16:31:01 -08:00
shockrah
080b2cc538 * update_channels_list now literally updates the channel list with the correct hooks
! Callback hooks are not featured yet but they are registered in the DOM
2021-03-03 16:29:59 -08:00
shockrah
25876f90e4 * Adapting auth module to new config structure
+ Explicit login route handler now in takes care of logging in to 1 specific domain on request

+ auth.init which just hits /login for all available servers it can find
2021-03-03 16:28:55 -08:00
shockrah
12c3d300ba * Updated html to receive /channel/list data
- Removing fluff from join modal
+ Setting up initial buttons in DOM for listing channels and pulling up menus and such
2021-03-03 16:27:06 -08:00
shockrah
143e6a1a77 Removing NODE_TLS_REJECT 2021-03-03 16:25:13 -08:00
shockrah
e4630199a6 Only using http in dev environments 2021-02-12 19:07:14 -08:00
shockrah
41bfd1cd89 Only building html with 200's in channel_list 2021-02-12 19:07:03 -08:00
shockrah
24a49663d2 dev_env environment var check 2021-02-12 18:13:24 -08:00
shockrah
d42c39d117 Hiding menu but not removing it anymore 2021-02-12 18:12:33 -08:00
shockrah
8fb0fdbeed Basic channel button css 2021-02-12 18:11:20 -08:00