addPost at botProfile fixed
This commit is contained in:
1 parent
a5c80fc152
commit
0be94e7e00
3 files changed
+33
-5
No files matched your search
@@ -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
|
||||
)
|
||||
|
||||
|
||||
+25
-1
@@ -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?
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user