Skip to content

Commit

Permalink
Merge pull request #138 from StarfilesFileSharing/alpha
Browse files Browse the repository at this point in the history
Alpha
  • Loading branch information
QuixThe2nd authored Nov 2, 2024
2 parents 9c766b0 + b390c8e commit 35f1505
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
23 changes: 21 additions & 2 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@starfiles/hydrafiles",
"version": "0.7.28",
"version": "0.7.29",
"description": "The web privacy layer.",
"main": "src/hydrafiles.ts",
"exports": {
Expand Down Expand Up @@ -39,7 +39,26 @@
"include": ["src/"],
"rules": {
"tags": ["recommended"],
"include": ["camelcase", "default-param-last", "eqeqeq", "explicit-function-return-type", "explicit-module-boundary-types", "guard-for-in", "no-const-assign", "no-inferrable-types", "no-non-null-assertion", "no-self-compare", "no-sparse-arrays", "no-sync-fn-in-async-fn", "no-throw-literal", "no-undef", "constructor-super", "no-async-promise-executor", "no-await-in-sync-fn", "valid-typeof"]
"include": [
"camelcase",
"default-param-last",
"eqeqeq",
"explicit-function-return-type",
"explicit-module-boundary-types",
"guard-for-in",
"no-const-assign",
"no-inferrable-types",
"no-non-null-assertion",
"no-self-compare",
"no-sparse-arrays",
"no-sync-fn-in-async-fn",
"no-throw-literal",
"no-undef",
"constructor-super",
"no-async-promise-executor",
"no-await-in-sync-fn",
"valid-typeof"
]
}
},
"fmt": {
Expand Down
2 changes: 1 addition & 1 deletion src/peers/RTCPeers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class RTCPeers {
return;
}

console.log(`WebRTC: (4/12): ${from} Received offer`, extractIPAddress(offer.sdp));
console.log(`WebRTC: (4/12): ${from} Received offer from`, extractIPAddress(offer.sdp));

this.peerConnections[from].answered = await this.createPeerConnection(from);
if (this.peerConnections[from].answered.conn.signalingState !== "stable" && this.peerConnections[from].answered.conn.signalingState !== "have-remote-offer") {
Expand Down
2 changes: 1 addition & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const handleRequest = async (req: Request, client: Hydrafiles): Promise<R
socket.addEventListener("message", ({ data }) => {
const message = JSON.parse(data) as Message;
for (let i = 0; i < sockets.length; i++) {
if (sockets[i].socket !== socket && (!("to" in message) || message.to === sockets[i].id)) {
if (sockets[i].socket !== socket && (message && !("to" in message) || message.to === sockets[i].id)) {
if (sockets[i].socket.readyState === 1) sockets[i].socket.send(data);
} else if ("from" in message) {
sockets[i].id = message.from;
Expand Down

0 comments on commit 35f1505

Please sign in to comment.