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

Add a contact add/remove button in chat #151

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

theurere
Copy link
Contributor

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.

chat-contact

@@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

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

this should be isUser

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to isUser.

@longsleep
Copy link
Contributor

Can you please rebase this on develop.

@theurere
Copy link
Contributor Author

theurere commented Apr 1, 2015

Rebased on develop.

subscope.isContact = event.type === "contactadded";
};
contacts.e.on("contactadded", subscope.updateContactStatus);
contacts.e.on("contactremoved", subscope.updateContactStatus);
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

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

With do you use !! ?

Copy link
Contributor Author

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.

@theurere
Copy link
Contributor Author

theurere commented Aug 5, 2015

I updated this to handle authenticationChanged (chatter login/out) and recieved.status (chattee login/out) events.

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