Skip to content

sendapatch/face2face

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FACE2FACE

Chat with random people from Facebook in your area

Talk to @lericson to get in on the project.

Design

Inspired by the Facebook chat

Implementation

The principal actors in play are:

  • Identity service (Facebook)
  • Chat service
  • Chat client
  • Chat partner

When the client is started it will first acquire its identity information from the identity service by way of user input or otherwise, then pass that identity to the chat service to register with the service.

An identity is the pair (source, id) and is encoded as ‘source:id’.

Note: The source must be ‘fb’ at present, and the ID is simply the Facebook user ID as a string.

Upon registration, the client sends its identity along with profile information.

  • name - full name
  • link - a link to the user’s profile
  • picture_url - profile picture URL
  • location - present location

Note: If the identity source is Facebook, picture_url will be forced to the identified user’s profile picture.

After registration is completed, the client must explicitly emit a ready event to connect with their soon-to-be chat partner.

Client-server Protocol

The protocol is fairly straight-forward. The chat clients may emit events to the chat server, which are acknowledged when the event has been processed. The server, too, emits events at times. However, due to technological limitations these are not actively acknowledged. (Of course, the lower layers of the network stack still guarantee delivery.)

  • register(id, profile) → (err)
  • location({latitude, longitude}) → (err)
  • ready() → (err, profile)
  • hangup() → (err)
  • transfer(message) → (err)
  • transfer(message)
  • hangup()

An example of a brief session could be:

C: register(‘fb:123’, {name: ‘Foo’}) → (null)
C: location({latitude: 59.3360, longitude: 18.0355}) → (null)
C: ready() → ({name: ‘Satan’})
C: transfer({body: ‘Hey Satan!’}) → (null)
S: transfer({body: ‘Sheeple...’})
C: location({latitude: 59.3361, longitude: 18.0349}) → (null)
S: hangup()
C: ready() → …

Server

The state for each client is (id) ⇒ (profile, location, call).

Client

Configuration

  • In JSON

  • Chat service URL

Notes & considerations

  • find options: accuracy in meters, gender, age, friends

  • befriending? suggest sending a certain message to the other party

  • update location?

  • tell users an estimate of distance between them?

  • tell users “Anna Ericson in Stockholm”

  • ignore location when accuracy is worse than 1000 meters

  • web front-end

  • ios front-end

update readme

About

Chat with random people from Facebook in your area

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • CoffeeScript 66.4%
  • JavaScript 33.6%