Flotype / now

NowJS makes it easy to build real-time web apps using JavaScript
http://www.nowjs.com
MIT License
1.91k stars 175 forks source link

Feature request - private 1 to 1 messaging #129

Closed inator closed 13 years ago

inator commented 13 years ago

Use case involves a user initiating communication to another user - therefore creating a dynamic private group for chatting. Ideally, there would be a function that takes a user array as an input parameter and returns a private group identifier that can then have chat entries directed to it without a general broadcast.

steveWang commented 13 years ago

For one-to-one communication, it is possible to get by with just nowjs.getClient(clientId, callback) (see API docs for more specifics), and for the second part of the request, well, that's what groups are for:

nowjs.generateGroup = function (id, arr) {
  var g = nowjs.getGroup(id);
  for (var i = 0; i < arr.length; i++) {
    g.addUser(arr[i]);
  }
  return g;
};
ericz commented 13 years ago

Let me know if you need further help on this issue @inator.

Closing