Post and Reaction Types
This commit is contained in:
1 parent
ace0f17ca8
commit
e54be502c9
4 files changed
+51
-29
No files matched your search
@@ -1607,6 +1607,18 @@
|
||||
"propertyName": "eventTypes",
|
||||
"functionName": "newSocialTradingGlobalsSignalTypes",
|
||||
"fileName": "SignalTypes.js"
|
||||
},
|
||||
{
|
||||
"name": "Post Types",
|
||||
"propertyName": "postTypes",
|
||||
"functionName": "newSocialTradingGlobalsPostTypes",
|
||||
"fileName": "PostTypes.js"
|
||||
},
|
||||
{
|
||||
"name": "Reaction Types",
|
||||
"propertyName": "reactionTypes",
|
||||
"functionName": "newSocialTradingGlobalsReactionTypes",
|
||||
"fileName": "ReactionTypes.js"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
exports.newSocialTradingGlobalsPostTypes = function () {
|
||||
|
||||
let thisObject = {
|
||||
/* Post Types */
|
||||
NEW_POST: 0,
|
||||
REPLY_TO_POST: 1,
|
||||
REPOST_: 2,
|
||||
QUOTE_REPOST_: 3
|
||||
}
|
||||
|
||||
return thisObject
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
exports.newSocialTradingGlobalsReactionTypes = function () {
|
||||
|
||||
let thisObject = {
|
||||
/* Reaction Types */
|
||||
REACTION_LIKE: 0,
|
||||
REACTION_LOVE: 1,
|
||||
REACTION_HAHA: 2,
|
||||
REACTION_WOW: 3,
|
||||
REACTION_SAD: 4,
|
||||
REACTION_ANGRY: 5,
|
||||
REACTION_CARE: 6
|
||||
}
|
||||
|
||||
return thisObject
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
exports.newSocialTradingModulesSocialGraphPost = function newSocialTradingModulesSocialGraphPost() {
|
||||
/*
|
||||
Posts represent a collection of multimedia content sorted somewhere else
|
||||
Posts represent a collection of multimedia content stored somewhere else
|
||||
and identified by that content hash. Posts might belong to:
|
||||
* a User Profile.
|
||||
* a Bot Profile.
|
||||
@@ -34,33 +34,16 @@ exports.newSocialTradingModulesSocialGraphPost = function newSocialTradingModule
|
||||
finalize: finalize
|
||||
}
|
||||
|
||||
const POST_TYPES = {
|
||||
NEW_POST: 0,
|
||||
REPLY_TO_POST: 1,
|
||||
REPOST_: 2,
|
||||
QUOTE_REPOST_: 3
|
||||
}
|
||||
|
||||
const REACTION_TYPES = {
|
||||
REACTION_LIKE: 0,
|
||||
REACTION_LOVE: 1,
|
||||
REACTION_HAHA: 2,
|
||||
REACTION_WOW: 3,
|
||||
REACTION_SAD: 4,
|
||||
REACTION_ANGRY: 5,
|
||||
REACTION_CARE: 6
|
||||
}
|
||||
|
||||
thisObject.replies = new Map()
|
||||
|
||||
thisObject.reactions = new Map()
|
||||
thisObject.reactions.set(REACTION_TYPES.REACTION_LIKE, 0)
|
||||
thisObject.reactions.set(REACTION_TYPES.REACTION_LOVE, 0)
|
||||
thisObject.reactions.set(REACTION_TYPES.REACTION_HAHA, 0)
|
||||
thisObject.reactions.set(REACTION_TYPES.REACTION_WOW, 0)
|
||||
thisObject.reactions.set(REACTION_TYPES.REACTION_SAD, 0)
|
||||
thisObject.reactions.set(REACTION_TYPES.REACTION_ANGRY, 0)
|
||||
thisObject.reactions.set(REACTION_TYPES.REACTION_CARE, 0)
|
||||
thisObject.reactions.set(SA.projects.socialTrading.globals.reactionTypes.REACTION_LIKE, 0)
|
||||
thisObject.reactions.set(SA.projects.socialTrading.globals.reactionTypes.REACTION_LOVE, 0)
|
||||
thisObject.reactions.set(SA.projects.socialTrading.globals.reactionTypes.REACTION_HAHA, 0)
|
||||
thisObject.reactions.set(SA.projects.socialTrading.globals.reactionTypes.REACTION_WOW, 0)
|
||||
thisObject.reactions.set(SA.projects.socialTrading.globals.reactionTypes.REACTION_SAD, 0)
|
||||
thisObject.reactions.set(SA.projects.socialTrading.globals.reactionTypes.REACTION_ANGRY, 0)
|
||||
thisObject.reactions.set(SA.projects.socialTrading.globals.reactionTypes.REACTION_CARE, 0)
|
||||
|
||||
return thisObject
|
||||
|
||||
@@ -92,9 +75,9 @@ exports.newSocialTradingModulesSocialGraphPost = function newSocialTradingModule
|
||||
Let's find the Target Post
|
||||
*/
|
||||
if (
|
||||
thisObject.postType === POST_TYPES.REPLY_TO_POST ||
|
||||
thisObject.postType === POST_TYPES.REPOST_ ||
|
||||
thisObject.postType === POST_TYPES.QUOTE_REPOST_
|
||||
thisObject.postType === SA.projects.socialTrading.globals.postTypes.REPLY_TO_POST ||
|
||||
thisObject.postType === SA.projects.socialTrading.globals.postTypes.REPOST_ ||
|
||||
thisObject.postType === SA.projects.socialTrading.globals.postTypes.QUOTE_REPOST_
|
||||
) {
|
||||
/*
|
||||
Validate Target User Profile.
|
||||
@@ -113,7 +96,7 @@ exports.newSocialTradingModulesSocialGraphPost = function newSocialTradingModule
|
||||
Let's add this post to the replies of the Target Post
|
||||
*/
|
||||
if (
|
||||
thisObject.postType === POST_TYPES.REPLY_TO_POST
|
||||
thisObject.postType === SA.projects.socialTrading.globals.postTypes.REPLY_TO_POST
|
||||
) {
|
||||
targetPost.replies.set(thisObject.targetPostHash, thisObject.targetPostHash)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user