diff --git a/src/HTTP/JS/expanded.js b/src/HTTP/JS/expanded.js index d560879..82ca172 100644 --- a/src/HTTP/JS/expanded.js +++ b/src/HTTP/JS/expanded.js @@ -183,9 +183,9 @@ async function GetPost() { NumberOfThreads += 1; } // Replies, anyone? - let Context = await BlueskyAPI.GetPostThread(post.record.uri); + let Context = await BlueskyAPI.GetPostThread(post.post.uri); console.log(Context); - for (let i of Context.descendants) { + for (let i of Context.thread.replies) { TemporaryPost = await BlueskyReplyFunction(NumberOfThreads, i); ThreadedPost.push(TemporaryPost); // Any posts? Give them the thing :3 @@ -264,29 +264,23 @@ async function BlueskyThreadFunction(Id, post) { } async function BlueskyReplyFunction(Id, post) { - let OtherPost = await BlueskyAPI.GetPosts([post.uri]); - OtherPost = OtherPost.posts[0]; - let ShitHTML = "

" + OtherPost.author.handle + "

" + website + "


"; + let ShitHTML = "

" + post.post.author.handle + "

" + website + "


"; document.getElementsByTagName("body")[0].insertAdjacentHTML("beforeend", ShitHTML); - Text = BlueskyAPI.ApplyFacets(OtherPost.record, OtherPost.record.text); + Text = BlueskyAPI.ApplyFacets(post.post.record, post.post.record.text); Text = Text.replace(/\r?\n|\r/g, "
"); // Sensitive topic :3 - if (OtherPost.record.hasOwnProperty("labels") && OtherPost.record.labels.length != 0) { + if (post.post.record.hasOwnProperty("labels") && post.post.record.labels.length != 0) { document.getElementsByClassName("PostText " + Id)[0].innerHTML = "LABELS APPLIED: "; - for (let lab of OtherPost.value.labels.values) { + for (let lab of post.post.value.labels.values) { document.getElementsByClassName("PostText " + Id)[0].innerHTML += lab.val + " "; } } else { document.getElementsByClassName("PostText " + Id)[0].innerHTML = Text; - if (OtherPost.record.hasOwnProperty("embed")) { - ApplyMedia(OtherPost.record.embed, document.getElementsByClassName("Images " + Id)[0], OtherPost.author.did); + if (post.post.record.hasOwnProperty("embed")) { + ApplyMedia(post.post.record.embed, document.getElementsByClassName("Images " + Id)[0], post.post.author.did); } } - // Get the reply and make it make sense. - if (OtherPost.record.hasOwnProperty("reply")) { - OtherPost.reply = OtherPost.record.reply; - } - return OtherPost; + return post; } // Applyers. Essentially applies a thing to an operation.