Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messages/Alerts #30

Open
bates64 opened this issue Jul 3, 2016 · 22 comments
Open

Messages/Alerts #30

bates64 opened this issue Jul 3, 2016 · 22 comments

Comments

@bates64
Copy link
Contributor

bates64 commented Jul 3, 2016

Just like scratch.
No idea how we should implement this: @MegaApuTurkUltra ideas?
I feel like simply pushing to db.User.find(...).messages won't be robust enough

@MegaApuTurkUltra
Copy link
Member

Well we can have a message queue under the user schema. Different events would generate messages for that queue. We can utilize node's EventEmitter to have a robust events system.

@Arinerron
Copy link
Member

For commenting on resources you mean? What word filter would we implement?

@bates64
Copy link
Contributor Author

bates64 commented Jul 3, 2016

@Arinerron Not just for commenting, but yeah. There's already a wordfilter in place - porter from the old os. Try swearing in your about me

@jamesd-uk
Copy link

I think we need to add a couple more words :P

@Arinerron
Copy link
Member

@NanaLan Ehh, I'll just trust you :P

@bates64
Copy link
Contributor Author

bates64 commented Jul 3, 2016

@The-Cheese-Eater commit them then

@jamesd-uk
Copy link

67ef23f

@Arinerron
Copy link
Member

We should use Scratch's swear remover. Theirs works much better, and then we can be sure Scratch approves if we use the same technology for filtering as them.

@bates64
Copy link
Contributor Author

bates64 commented Jul 3, 2016

@Arinerron we're using exactly the same filter as llk/s2forums.

@Arinerron
Copy link
Member

@NanaLan Really? Scratch's filter is that bad at catching them? I remember a comment on @thisandagain's profile about which filter they used for commenting, and I'm fairly certain it wasn't how we are doing it :P

@thisandagain
Copy link

The filter shown in llk/s2forums is not what we use in production.

@bates64
Copy link
Contributor Author

bates64 commented Jul 5, 2016

@thisandagain Oh, oops... What filter would you recommend we use? 😃

@Tymewalk
Copy link
Contributor

Tymewalk commented Jul 5, 2016

Didn't OpenSprites previously use a big list of swear words? I remember seeing a link somewhere in the old repo.

@bates64
Copy link
Contributor Author

bates64 commented Jul 6, 2016

@Tymewalk Yes, and that's what we're using now. It's the same as llk/s2forums, but apparently that's not what they use in production...

@MegaApuTurkUltra
Copy link
Member

MegaApuTurkUltra commented Jul 13, 2016

Ideas:

Message schema

type: enum [comment, download, collection_add, forum_activity],
subtype: enum [resource, collection, profile, forum_section, forum_topic],
where: {
    kind: what schema this links to,
    item: ObjectId to wherever this is located
}
when: Date

(more info can be gained from the ObjectId link to generate the message)

Alert schema

from: String (moderator name)
message: String
when: Date

I'll turn the current User model into an OpenSprites model like I did with Resource and Collection and then we can add this 📦

@MegaApuTurkUltra
Copy link
Member

MegaApuTurkUltra commented Jul 13, 2016

Also, instead of spamming users messages for each individual action that occurs (like Scratch), we should collapse messages in the queue

Example:

We should also have settings for what types of messages to display (filter by type and subtype fields we have in the schema)

@rumanti
Copy link
Member

rumanti commented Jul 14, 2016

A filter would be nice. Which 'phase' would be better for filtering things out, though? Backend or frontend? (out of curiousity)

@bates64
Copy link
Contributor Author

bates64 commented Jul 14, 2016

Probably the server.

@MegaApuTurkUltra
Copy link
Member

Rule #1 of web programming is that you never trust the client.

If we let the client do filtering, haxx0rs would submit unfiltered content

@Arinerron Arinerron added this to the Initial Release milestone Jul 15, 2016
@bates64
Copy link
Contributor Author

bates64 commented Jul 15, 2016

@MegaApuTurkUltra I thought @rumanti meant the client doing something like this?

const res = await ajax.get('/messages')
const filter = { type: 'comment' }
let msgs = res.filter(msg => msg.type === filter.type) // here!
// do something to parse the mesages into htmk
document.querySelector('#messages').innerHTML = msgs

If we let the client do filtering, haxx0rs would submit unfiltered content

...but they don't submit anything, right?

@MegaApuTurkUltra
Copy link
Member

MegaApuTurkUltra commented Jul 15, 2016

Oh, I was confused because we were talking about bad word filtering in this thread 😜

We should do it on the server to avoid sending unnecessary data to the client though

@bates64
Copy link
Contributor Author

bates64 commented Jul 15, 2016

But if we can do it on the client, it'd basically be instant - and it can be in a single page rather than forcing the page to go to/ajax.get /messages?type=comment

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

No branches or pull requests

7 participants