Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Alex Reed
40 Pointsparse how would you block a messages sent from a blocked user to current user ?
Can't seem to think of or find a good blocking algorithm
1 Answer
James Simshaw
28,738 PointsHello,
You could keep a list of blocked users attached to each user then check if the message has one of those user ids attached to it, either delete the message or at least not to display it.
Alex Reed
40 PointsAlex Reed
40 Pointsgosh you are a genious.
Haroon Akhtar
3,129 PointsHaroon Akhtar
3,129 Pointshow can you check if the message has one of those userIds attached to it