-
Notifications
You must be signed in to change notification settings - Fork 1
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
[WIP] candy:core:chat:invite triggerHandler #4
base: dev
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -482,9 +482,19 @@ Candy.Core.Event = (function(self, Strophe, $) { | |
} | ||
|
||
if(directInvite.length > 0) { | ||
fromUser = Candy.Core.getRoster().get(msg.attr('from')); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, open question (including @bklang): how do we treat users who aren't in our roster? Do we pass through the JID instead of a Contact, or do we pass something API-compatible with Contact but which nevertheless indicates absence of full details from the roster and is scoped only to this event? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am inclined to think something API-compatible with a Contact, but with the missing fields returning nil/undefined or empty strings. May also add a boolean for "in roster?" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also 👍 |
||
room = Candy.Core.getRoom(directInvite.attr('jid')); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is an invite, we won't have the room object yet - is it useful to pre-load it into the collection (potential memory leak) or do we just go back to passing the JID forward (perhaps as a JID object rather than a string)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, right. What I've been doing in this case is just keeping the |
||
|
||
/* | ||
* (Candy.Core.Chatroom) room - | ||
* (Candy.Core.Contact) from - | ||
* (String) reason - | ||
* (String) password - | ||
* (String) continuedThread - | ||
*/ | ||
invite = { | ||
roomJid: directInvite.attr('jid'), | ||
from: msg.attr('from'), | ||
room: room, | ||
from: fromUser, | ||
reason: directInvite.attr('reason'), | ||
password: directInvite.attr('password'), | ||
continuedThread: directInvite.attr('thread') | ||
|
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.
What's the difference between a mediated invite and a direct invite? Can we make any assumptions about whether the sender is in our global roster with one or the other?
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 don't think we can assume that either will come from someone in our roster. A mediated invite will actually come from the MUC service itself.
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.
Ah, ok. Thanks.