diff --git a/Network/botProfile.js b/Network/botProfile.js index 643571170..d53f060b8 100644 --- a/Network/botProfile.js +++ b/Network/botProfile.js @@ -49,10 +49,13 @@ exports.newUserProfile = function newUserProfile() { } function addPost( + emitterUserProfileId, + targetUserProfileId, + emitterBotProfileId, + targetBotProfileId, emitterPostHash, targetPostHash, postType, - botProfile, timestamp ) { if (NT.memory.maps.POSTS.get(emitterPostHash) !== undefined) { @@ -61,10 +64,13 @@ exports.newUserProfile = function newUserProfile() { let post = NT.modules.POST.newPost() post.initialize( + emitterUserProfileId, + targetUserProfileId, + emitterBotProfileId, + targetBotProfileId, emitterPostHash, targetPostHash, postType, - botProfile, timestamp ) diff --git a/Network/event.js b/Network/event.js index 7cddc9c22..2793244a9 100644 --- a/Network/event.js +++ b/Network/event.js @@ -128,9 +128,33 @@ exports.newEvent = function newEvent() { thisObject.eventType - 10, thisObject.timestamp ) + return } + if ( + thisObject.eventType === EVENT_TYPES.NEW_BOT_POST || + thisObject.eventType === EVENT_TYPES.REPLY_TO_BOT_POST || + thisObject.eventType === EVENT_TYPES.REPOST_BOT_POST || + thisObject.eventType === EVENT_TYPES.QUOTE_REPOST_BOT_POST + ) { + let botProfile = emitterUserProfile.bots.get(emitterBotProfileId) + if ( + botProfile === undefined + ) { + throw ('Emitter BOt Profile Not Found.') + } - return + botProfile.addPost( + thisObject.emitterUserProfileId, + thisObject.targetUserProfileId, + thisObject.emitterBotProfileId, + thisObject.targetBotProfileId, + thisObject.emitterPostHash, + thisObject.targetPostHash, + thisObject.eventType - 20, + thisObject.timestamp + ) + return + } } /* Is is a following? diff --git a/Network/userProfile.js b/Network/userProfile.js index a7d308cf6..161aaa801 100644 --- a/Network/userProfile.js +++ b/Network/userProfile.js @@ -62,7 +62,6 @@ exports.newUserProfile = function newUserProfile() { emitterPostHash, targetPostHash, postType, - userProfile, timestamp ) { if (NT.memory.maps.POSTS.get(emitterPostHash) !== undefined) { @@ -78,7 +77,6 @@ exports.newUserProfile = function newUserProfile() { emitterPostHash, targetPostHash, postType, - userProfile, timestamp )