Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Adding the factoid's creator and a list of its editors to the JSON database #7

Merged
merged 5 commits into from Sep 23, 2012

Conversation

Projects
None yet
3 participants
Member

ljharb commented Sep 23, 2012

Adding the factoid's creator and a list of its editors to the JSON database.

context.sender.name should be used here. context.sender is simply an object representing an IRC user. The name property is a string value representing the IRC nick of the user.

Remove that extra space please :) Also context.sender.name

username should not already be in the editors array

Owner

ljharb replied Sep 23, 2012

I'm not sure I understand your comment, but I do notice that a username could get added multiple times since I'm not deduping. Is that what you're referring to?

Yeah so I something like this would fix the problem:

editors = db[key].editors || [];
if (editors.indexOf(username) === -1) {
    editors.push(username);
}

@dsamarin dsamarin added a commit that referenced this pull request Sep 23, 2012

@dsamarin dsamarin Merge pull request #7 from ljharb/factoid_username_tracking
Adding the factoid's creator and a list of its editors to the JSON database
8a35950

@dsamarin dsamarin merged commit 8a35950 into oftn-oswg:master Sep 23, 2012

Member

devyn commented Sep 26, 2012

Neat.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment