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

Update Chat.jsx #894

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Update Chat.jsx #894

wants to merge 2 commits into from

Conversation

nmywn
Copy link
Contributor

@nmywn nmywn commented Jan 3, 2017

Im not sure if this code will work now, but what I'm trying to do is broadcast information about the tip being made. For now it is broadcasted locally and I think its wrong. Shouldn't be like that. Tips can be used to tip people that are helpful or funny, but it makes more sense when info about that event is broadcasted to all, otherwise it feels creepy.
I think automatic memo is also better aproach, less effort for sender, but he can change if he wish.
This scheme could go further with for example Options: defaultTip = 100, defaultToken = BTS . That way user effort is limited to simple /tip user even is he wish use nonstandard values.

Those parameters can be also overwrited as user is typing:

/tip user notDefaultValue
/tip user notDefaultValue notDefaultValue
and so on...

Im not sure if this code will work now, but what I'm trying to do is broadcast information about the tip being made. For now it is broadcasted locally and I think its wrong. Shouldn't be like that. Tips can be used to tip people that are helpful or funny, but it makes more sense when info about that event is broadcasted to all, otherwise it feels creepy.
I think automatic memo is also better aproach,  less effort for sender, but he can change if he wish.
This scheme could go further with for example Options: defaultTip = 100,  defaultToken = BTS . That way user effort is limited to simple /tip user even is he wish use nonstandard values.


Those parameters can be also overwrited as user is typing:

 /tip user notDefaultValue
/tip user notDefaultValue notDefaultValue
and so on...
message: this.props.currentAccount + " tipped " + tip.to + " " + tip.amount + " " + tip.asset,
color: "#B71A00"
};

// Public and local broadcast
this._broadCastMessage(message);
this._broadCastMessage(message, local = false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will throw an error because local is not defined here. The local flag is used in _broadCastMessage to also show the message locally, so the tip message is already being broadcast to all other users.

Copy link
Contributor Author

@nmywn nmywn Jan 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasnt working for me yesterday... I should test better before trying to "fix" something. All because chat history works not so good. I understand (not sure) that history is taken from first random peer, but some peers have more history than others. In consequence, if I'm really unlucky my history count is 0, no messages at all. This can perhaps work if trollbox being crowded, but for now it sucks. Would be very cool if I could read last 100 messages, not just 2. Something like if history < 100 {search peer with longest history} would be cool.

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

Successfully merging this pull request may close these issues.

2 participants