Superalgos Network: Events Query implemented. Deep Scan Bug Fixed #2
This commit is contained in:
1 parent
72cf70617d
commit
f997021c0d
5 files changed
+68
-12
No files matched your search
@@ -223,13 +223,13 @@ exports.newEvents = function newEvents() {
|
||||
|
||||
function addPost(post) {
|
||||
let postResponse = {
|
||||
emitterUserProfileId: post.emitterUserProfileId,
|
||||
targetUserProfileId: post.targetUserProfileId,
|
||||
emitterPostHash: post.emitterPostHash,
|
||||
targetPostHash: post.targetPostHash,
|
||||
postType: post.postType,
|
||||
userProfile: post.userProfile.userProfieId,
|
||||
timestamp: post.timestamp,
|
||||
repliesCount: post.replies.length,
|
||||
targetPostHash: post.targetPost.emitterPostHash,
|
||||
reactionsCount: []
|
||||
}
|
||||
|
||||
|
||||
@@ -109,13 +109,13 @@ exports.newPostReplies = function newPostReplies() {
|
||||
|
||||
function addToResponse(post) {
|
||||
let postResponse = {
|
||||
emitterUserProfileId: post.emitterUserProfileId,
|
||||
targetUserProfileId: post.targetUserProfileId,
|
||||
emitterPostHash: post.emitterPostHash,
|
||||
targetPostHash: post.targetPostHash,
|
||||
postType: post.postType,
|
||||
userProfile: post.userProfile.userProfieId,
|
||||
timestamp: post.timestamp,
|
||||
repliesCount: post.replies.length,
|
||||
targetPostHash: post.targetPost.emitterPostHash,
|
||||
reactionsCount: []
|
||||
}
|
||||
|
||||
|
||||
@@ -113,13 +113,13 @@ exports.newProfilePosts = function newProfilePosts() {
|
||||
|
||||
function addToResponse(post) {
|
||||
let postResponse = {
|
||||
emitterUserProfileId: post.emitterUserProfileId,
|
||||
targetUserProfileId: post.targetUserProfileId,
|
||||
emitterPostHash: post.emitterPostHash,
|
||||
targetPostHash: post.targetPostHash,
|
||||
postType: post.postType,
|
||||
userProfile: post.userProfile.userProfieId,
|
||||
timestamp: post.timestamp,
|
||||
repliesCount: post.replies.length,
|
||||
targetPostHash: post.targetPost.emitterPostHash,
|
||||
reactionsCount: []
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -8,9 +8,8 @@ exports.newPost = function newPost() {
|
||||
postType: undefined,
|
||||
timestamp: undefined,
|
||||
replies: undefined,
|
||||
targetPost: undefined,
|
||||
reactionsCount: undefined,
|
||||
reactionTypesCount: undefined,
|
||||
reactionTypesCount: undefined,
|
||||
addReaction: addReaction,
|
||||
removeReactions: removeReaction,
|
||||
initialize: initialize,
|
||||
@@ -59,7 +58,6 @@ exports.newPost = function newPost() {
|
||||
thisObject.postType = undefined
|
||||
thisObject.timestamp = undefined
|
||||
thisObject.replies = undefined
|
||||
thisObject.targetPost = undefined
|
||||
}
|
||||
|
||||
function initialize(
|
||||
@@ -82,6 +80,8 @@ exports.newPost = function newPost() {
|
||||
/*
|
||||
Let's find the Target Post
|
||||
*/
|
||||
let targetPost
|
||||
|
||||
if (
|
||||
event.eventType === POST_TYPES.REPLY_TO_MULTI_MEDIA_POST ||
|
||||
event.eventType === POST_TYPES.REPOST_MULTI_MEDIA ||
|
||||
@@ -90,9 +90,9 @@ exports.newPost = function newPost() {
|
||||
event.eventType === POST_TYPES.RE_POST_TRADE ||
|
||||
event.eventType === POST_TYPES.QUOTE_REPOST_TRADE
|
||||
) {
|
||||
thisObject.targetPost = NT.memory.maps.POSTS.get(thisObject.targetPostHash)
|
||||
targetPost = NT.memory.maps.POSTS.get(thisObject.targetPostHash)
|
||||
|
||||
if (thisObject.targetPost === undefined) {
|
||||
if (targetPost === undefined) {
|
||||
throw ('Target Post Not Found.')
|
||||
}
|
||||
}
|
||||
@@ -103,7 +103,7 @@ exports.newPost = function newPost() {
|
||||
event.eventType === POST_TYPES.REPLY_TO_MULTI_MEDIA_POST ||
|
||||
event.eventType === POST_TYPES.REPLY_TO_TRADE_POST
|
||||
) {
|
||||
thisObject.targetPost.replies.push(thisObject)
|
||||
targetPost.replies.push(thisObject)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user