From 40c7307086fa02c92e88b797e520e19926fb5235 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Fri, 3 Sep 2021 15:56:30 +0200 Subject: [PATCH] Molutple Users Followed --- Desktop/DesktopApp.js | 1 + Projects/Social-Trading/NT/Modules/Event.js | 43 +++++++++++++-------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/Desktop/DesktopApp.js b/Desktop/DesktopApp.js index 5f3759939..91fc7a832 100644 --- a/Desktop/DesktopApp.js +++ b/Desktop/DesktopApp.js @@ -51,6 +51,7 @@ exports.newDesktopApp = function newDesktopApp() { Test Following Profiles. */ let eventMessage = { + eventId: i, eventType: SA.projects.socialTrading.globals.eventTypes.FOLLOW_USER_PROFILE, emitterUserProfileId: DK.TEST_NETWORK_CLIENT_USER_PROFILE_ID, targetUserProfileId: profile.userProfileId diff --git a/Projects/Social-Trading/NT/Modules/Event.js b/Projects/Social-Trading/NT/Modules/Event.js index 271f87ebd..7db74847a 100644 --- a/Projects/Social-Trading/NT/Modules/Event.js +++ b/Projects/Social-Trading/NT/Modules/Event.js @@ -96,11 +96,22 @@ exports.newSocialTradingModulesEvent = function newSocialTradingModulesEvent() { } } - postingEvents() - followingEvents() - reactionEvents() - botEvents() - eventCounters() + if (postingEvents()) { + eventCounters() + return + } + if (followingEvents()) { + eventCounters() + return + } + if (reactionEvents()) { + eventCounters() + return + } + if (botEvents()) { + eventCounters() + return + } function postingEvents() { /* @@ -135,7 +146,7 @@ exports.newSocialTradingModulesEvent = function newSocialTradingModulesEvent() { thisObject.eventType - 10, thisObject.timestamp ) - return + return true } /* New Bot Post @@ -160,7 +171,7 @@ exports.newSocialTradingModulesEvent = function newSocialTradingModulesEvent() { thisObject.eventType - 20, thisObject.timestamp ) - return + return true } /* Remove User Post @@ -171,7 +182,7 @@ exports.newSocialTradingModulesEvent = function newSocialTradingModulesEvent() { emitterUserProfile.removePost( thisObject.emitterPostHash ) - return + return true } /* Remove Bot Post @@ -186,7 +197,7 @@ exports.newSocialTradingModulesEvent = function newSocialTradingModulesEvent() { emitterBotProfile.removePost( thisObject.emitterPostHash ) - return + return true } } } @@ -277,7 +288,7 @@ exports.newSocialTradingModulesEvent = function newSocialTradingModulesEvent() { break } } - return + return true } } @@ -302,13 +313,13 @@ exports.newSocialTradingModulesEvent = function newSocialTradingModulesEvent() { } else { targetPost = targetUserProfile.posts.get(thisObject.targetPostHash) } - + if (targetPost === undefined) { throw ('Target Post Not Found') } targetPost.addReaction(thisObject.eventType - 100) - return + return true } if ( thisObject.eventType === SA.projects.socialTrading.globals.eventTypes.REMOVE_REACTION_LIKE || @@ -325,13 +336,13 @@ exports.newSocialTradingModulesEvent = function newSocialTradingModulesEvent() { } else { targetPost = targetUserProfile.posts.get(thisObject.targetPostHash) } - + if (targetPost === undefined) { throw ('Target Post Not Found') } - + targetPost.removeReaction(thisObject.eventType - 200) - return + return true } } @@ -375,7 +386,7 @@ exports.newSocialTradingModulesEvent = function newSocialTradingModulesEvent() { break } } - return + return true } }