Bug Fixed with Following and Followers of Bots
This commit is contained in:
1 parent
c7011e4183
commit
dec4541210
2 files changed
+16
-12
No files matched your search
+14
-12
@@ -109,38 +109,40 @@ exports.newBotProfile = function newBotProfile() {
|
||||
}
|
||||
|
||||
function addFollowing(
|
||||
targetUserProfileId
|
||||
targetUserProfileId,
|
||||
targetBotProfileId
|
||||
) {
|
||||
if (thisObject.following.get(targetUserProfileId) === undefined) {
|
||||
thisObject.following.set(targetUserProfileId, targetUserProfileId)
|
||||
if (thisObject.following.get(targetBotProfileId) === undefined) {
|
||||
thisObject.following.set(targetBotProfileId, { targetUserProfileId: targetUserProfileId, targetBotProfileId: targetBotProfileId })
|
||||
} else {
|
||||
throw ('Already Following.')
|
||||
}
|
||||
}
|
||||
|
||||
function removeFollowing(
|
||||
targetUserProfileId
|
||||
targetBotProfileId
|
||||
) {
|
||||
if (thisObject.following.get(targetUserProfileId) !== undefined) {
|
||||
thisObject.following.delete(targetUserProfileId)
|
||||
if (thisObject.following.get(targetBotProfileId) !== undefined) {
|
||||
thisObject.following.delete(targetBotProfileId)
|
||||
} else {
|
||||
throw ('Not Following.')
|
||||
}
|
||||
}
|
||||
|
||||
function addFollower(
|
||||
emitterUserProfileId
|
||||
emitterUserProfileId,
|
||||
emitterBotProfileId
|
||||
) {
|
||||
if (thisObject.followers.get(emitterUserProfileId) === undefined) {
|
||||
thisObject.followers.set(emitterUserProfileId, emitterUserProfileId)
|
||||
if (thisObject.followers.get(emitterBotProfileId) === undefined) {
|
||||
thisObject.followers.set(emitterBotProfileId, { emitterUserProfileId: emitterUserProfileId, emitterBotProfileId: emitterBotProfileId })
|
||||
}
|
||||
}
|
||||
|
||||
function removeFollower(
|
||||
emitterUserProfileId
|
||||
emitterBotProfileId
|
||||
) {
|
||||
if (thisObject.followers.get(emitterUserProfileId) !== undefined) {
|
||||
thisObject.followers.delete(emitterUserProfileId)
|
||||
if (thisObject.followers.get(emitterBotProfileId) !== undefined) {
|
||||
thisObject.followers.delete(emitterBotProfileId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,9 +289,11 @@ exports.newEvent = function newEvent() {
|
||||
}
|
||||
|
||||
emitterBotProfile.addFollowing(
|
||||
targetUserProfileId,
|
||||
targetBotProfileId
|
||||
)
|
||||
targetBotProfile.addFollower(
|
||||
emitterUserProfileId,
|
||||
emitterBotProfileId
|
||||
)
|
||||
break
|
||||
|
||||
Reference in new issue
Block a user