Commit Graph

15 Commits (7887786b007df25d33bdc01f054ea2e761c4edec)

Author SHA1 Message Date
Beaudan c59b196487 Now reading messages and adding them to conversations. Some cleaning of unreachable code. Modified the message data to be encoded as base64 string before sending to server
Sending our public key in header of message

Now attaching our key to the source field when sending messages, allows messages to be decrypted with the fallback cypher

Now polling the server for messages every 5 seconds

Sending the source device with messages

Added mock respond function to request to leave it that same as the websocket stuff. RetrieveMessages now just returns the result

Polling now continues if the server responds with an error. Returning only the result from sendMessage and retrieveMessages

Revert commenting of unreachable code

Refactored http logic into own file

Revert a change to websocket-resources
7 years ago
Beaudan 1ccf3b6b95 Added function to loki_message_api to do a single request call to storage server. Currently just gets called once when the application starts 7 years ago
Beaudan 519d372e63 Tiny url update to work with the storage server 7 years ago
sachaaaaa 4b9fcb98d4 Linting and other housekeeping stuff 7 years ago
Beaudan 4598fd222a Cleaned up newNonce stuff. Now doing target calculation with BigIntegers 7 years ago
Beaudan d4180b3ca6 Some syntax tidying up, plus fixed bug with message data not being a uint8array after IPC message 7 years ago
Beaudan dfa8b59bc3 Using let and const properly, updated number to uint function, general cleaning 7 years ago
Beaudan ee57c698d7 Client side proof of work attached to messages
Skeleton calcPoW function that prepares payload for hashingFunction to increment Uint8Array nonce

Util function for converting a number to its Uint8Array representation

Actually perform calculate PoW nonce for every message

Adding bytebuffer as dependency and updated package-lock

Move PoW to new file and execute it in child process

TODO: Move send message logic to callback after child process has finished calculating the PoW

Refactored nonce calculation to function to be awaited

More readable timestamp grab plus converted to seconds

Nonce is now returned as a base64 string and included in request header

Also converted timestamp and ttl to string when including them in the header

Added a couple comments and tidied up some nonce logic
7 years ago
sachaaaaa 6fe70b9b85 Send outgoing messages as raw bytes (Uint8Array) and moved recipient & ttl to header 7 years ago
sachaaaaa a6b4215b1f changed sendMessage request from PUT to POST 7 years ago
sachaaaaa 8bb7185c7a make loki_message_api::sendMessage use async/await 7 years ago
sachaaaaa 0832806bd9 wip: added helper to create mock contacts, almost got a session working 7 years ago
sachaaaaa b84ff76faf Fix error handling when sending message + clean up in loki_message_api 7 years ago
sachaaaaa 8ada6ce8ad serialize message as base64 7 years ago
sachaaaaa 1e14022e2f Add skeleton for Loki Message API. Wrap data in json (for now?) 7 years ago