Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #796
I think It would be good to add an ability to like other peoples messages.
Reason
Disclosure
This is more of a technical demo since I didn't want to to open a feature request without doing leg work on figuring out the implementation. I'm happy to keep iterating from your feedback but I think this was a good point to open a pr lest I spend ages refining a feature no one wants. I'm not super confident with web sockets so please do correct me if I say or do something that doesn't make sense.
Implementation
Since ther is no message id (as far as I can tell?) I use display Name + timestamp to identify the message being liked.
Add a new LIKEMSG event wich has the following:
1. Nick: The DisplayName of the user liking it
2. Timestamp: Time when user liked
3. MessageNick: DisplayName of the user who sent the message thats being liked
4. MessageTimestamp: The Timestamp of the message we are liking
When any user likes a message a small ghost heart floats up behind the heart icon.
Video.Project.2.mp4
If the active user likes a message a background square glow appears. The user cant like that message again then. It decides if the current user has liked a message by comparing the
nickin theLIKEMSGevent (user who sent the like) to the current userdisplayName:The message stores number of likes which is converted into a like level. Depending on the number of likes the heart changes colours according to this gradient:
1 like -> level 1
5 likes -> level 2
...
100 likes -> level 6
If a unauthorised user tries to like a message they are shown the log in pop up
Demo
I cant tell if I'm being stupid but I cant find an active repository for the server side code. So I
console.logsend events and I imitate receiving events by manually triggeringsource.parseAndDispatchusing dev console.Video.Project.1.mp4
Limitations of current implementation
Email: bpavlov2001@gmail.com