Question
Private Messages
In the following function I am trying to send a message
directly to a recipient (toWhom parameter = client.user.userName)
as a private message, but cannot resolve how to do so...any
suggestions/hints?
I have tried several conditional loops, but am wholly unsuccessful...
I have tried several conditional loops, but am wholly unsuccessful...
quote:
Code
VideoConference.prototype.deliverMessage = function(client, msg, toWhom)
{
var now = new Date();
this.startTime = now.getTime();
var str = now.getHours() + ":";
var mins = now.getMinutes();
str += (mins>=10) ? mins : "0"+mins
if (toWhom == "everyone")
{
//Public
this.history_s.send("appendMessage", " { " + client.ip +" } " + client.user.userName+" @ "+ str + " : " + msg);
this.messages_so.send("showMessage", " { " + client.ip +" } " + client.user.userName+" @ "+ str + " : " + msg);
return;
}
else if (toWhom != "everyone")
{
//Private
this.messages_so.send("showMessage", " { " + client.ip +" } " + client.user.userName+" @ "+ str + " : " + msg);
return;
}
}