-
Notifications
You must be signed in to change notification settings - Fork 0
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
First version of private-mode, invite-only WeChat #11
Open
lucyhe
wants to merge
17
commits into
master
Choose a base branch
from
invitev1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
…ine. (This is flaky for some reason depending on which test account I use. It always seems to work for Sam, but not for Blair.)
Do you have / need a reviewer for this? |
@@ -208,41 +191,33 @@ WechatSocialProvider.prototype.initHandlers_ = function() { | |||
var selfContact = this.client.thisUser.UserName; |
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.
remove: + Object.keys(this.client.chatrooms).length
Oh! It's almost ready (working through a few things with Spencer). Can I ping you? Thank you!!! |
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.
Invite v1 implementation:
Invites get tricky because you might send invites to offline friends (WeChat does not yet have presence/a heartbeat). To resolve this, two things were necessary:
(1) On login, resend invites to all users who are in invitesSent but not in invitesReceived
(2) If we receive an invite from someone in invitesSent but not invitesReceived, assume they did not receive your invite, and resend an invite back.
Both invites sent to online users.
A and B are both online.
A sends invite to B.
B receives invite.
B sends invite to A. A is now a friend.
A receives invite. B is now a friend.
(Because of (2) above, A sends another invite back to B, because it is not sure if B received the original invite, but this additional invite effectively does nothing.)
One invite is sent to offline user.
A is online. B is offline.
A sends invite to B.
B comes online.
B sends invite to A.
A receives invite. B is now a friend.
Again, because of (2) above, A sends another invite back to B.
B receives invite. A is now a friend.
Both invites are sent to offline users; they become friends when they are both online together.
A and B are both offline.
A comes online.
A sends invite to B.
A goes offline.
B comes online.
B sends invite to A.
A comes online.
Because of (1), A sends an invite to B.
B receives invite. A is now a friend.
Because of (2), B sends another invite back to A.
A receives invite. B is now a friend.
The reason (2) doesn't cause an infinite loop of invites is that we have two types of invites. INVITE and RETURN_INVITE. Users only respond to INVITE's with RETURN_INVITE's.
Another note: this removes the chatrooms, so would it be better if this is in another branch?
Also: investigate chatroom icon errors?