working on showing single posts for users we dont know about

This commit is contained in:
2025-12-31 07:11:35 +00:00
parent 5a6691a214
commit 3a056dffce
7 changed files with 19 additions and 40 deletions

View File

@@ -172,17 +172,9 @@ export class App {
for (let userID of userIDs) {
// console.log.apply(null, log(`[app] announceUsers, got user:${userID} from peer ${sendingPeerID}`));
this.sync.addUserPeer(userID, sendingPeerID);
const isUserOrPostRoute = (this.router.route & (App.Route.USER | App.Route.POST)) !== 0;
if (isUserOrPostRoute) {
if (userID !== this.router.userID) {
continue;
}
}
else {
if (!this.sync.shouldSyncUserID(userID)) {
console.log.apply(null, log(`[app] announceUser_rpc_response skipping user[${logID(userID)}] from[${logID(sendingPeerID)}]`));
continue;
}
if (!(this.sync.shouldSyncUserID(userID) || (this.router.route & (App.Route.USER | App.Route.POST) && userID === this.router.userID))) {
console.log.apply(null, log(`[app] announceUser_rpc_response skipping user[${logID(userID)}] from[${logID(sendingPeerID)}]`));
continue;
}
console.log.apply(null, log(`[app] calling getPostIDsForUser for user [${logID(userID)}] on peer [${logID(sendingPeerID)}]`));
this.statusBar.updatePeerStatus(sendingPeerID, `getPostIDs(${logID(userID)})⬆️`);
@@ -817,8 +809,7 @@ export class App {
this.timerStart();
let posts = [];
if (postID) {
const post = await getPostForUser(userID, postID);
posts = post ? [post] : [];
posts = await getPostForUser(userID, postID);
}
else {
posts = await getData(userID, new Date(2022, 8), new Date());

File diff suppressed because one or more lines are too long

View File

@@ -399,7 +399,7 @@ class PeerConnection {
this.chunkSize = (16 * 1024) - 100;
this.messageSuperlog = false;
this.sendQueueSuperLog = false;
this.rpcSuperlog = false;
this.rpcSuperlog = true;
this.pendingRPCs = new Map();
this.connectionPromise = null;
// private makingOffer:boolean = false;
@@ -730,9 +730,9 @@ PeerConnection.config = {
// { urls: "turn:ddln.app", username: "a", credential: "b" },
{ urls: "stun:stun.l.google.com" }, // keeping this for now as my STUN server is not returning ipv6
{ urls: "stun:stun1.l.google.com" },
{ urls: "stun:stun2.l.google.com" },
{ urls: "stun:stun3.l.google.com" },
{ urls: "stun:stun4.l.google.com" },
//{ urls: "stun:stun2.l.google.com" },
//{ urls: "stun:stun3.l.google.com" },
//{ urls: "stun:stun4.l.google.com" },
],
};
//# sourceMappingURL=PeerManager.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long