-
Notifications
You must be signed in to change notification settings - Fork 259
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
Add a contact add/remove button in chat #151
base: develop
Are you sure you want to change the base?
Conversation
@@ -214,6 +215,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro | |||
subscope.p2pstate = false; | |||
subscope.active = false; | |||
subscope.pending = 0; | |||
subscope.isuser = !!(buddy && buddy.session && buddy.session.Userid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be isUser
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to isUser
.
768e08d
to
ede149c
Compare
Can you please rebase this on develop. |
ede149c
to
eb6fff5
Compare
Rebased on develop. |
subscope.isContact = event.type === "contactadded"; | ||
}; | ||
contacts.e.on("contactadded", subscope.updateContactStatus); | ||
contacts.e.on("contactremoved", subscope.updateContactStatus); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not make sense and needs fixing. This events trigger for all contacts and need to be limited/matched to the user in this subscope what so ever. In general i would like it if this two events could be avoided alltogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am filtering now by userid
to correctly handle this. Not sure what else I would use to handle this, other then the contacts api.
eb6fff5
to
059416a
Compare
@@ -216,6 +217,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro | |||
subscope.p2pstate = false; | |||
subscope.active = false; | |||
subscope.pending = 0; | |||
subscope.isUser = !!(buddy && buddy.session && buddy.session.Userid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With do you use !! ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want a type of boolean.
…ontact is added or removed.
… button when the person cannot be added as a contact.
059416a
to
1303213
Compare
I updated this to handle |
For single chat sessions and those that are 'users' add a contact add/remove star to the chat menu next to call, upload file, and geolocation.