function sendPost($params) { $argToken =& $params[0]; $otherPartyUsername =& $params[1]; $sendMessage =& $params[2]; $sendConfirm = false; $tokenObject = new NodeToken(); $tokenObject->retrieveToken($argToken); if ($tokenObject->valid) { $sourceUserId = $tokenObject->uid; $otherPartyUid = Planworld::nameToId($otherPartyUsername); Send::sendMessage($sourceUserId, $otherPartyUid, $sendMessage); /* The sendMessage function currently has no return code, so we fake it.*/ $sendConfirm = true; statusCode(201); } else { $sendConfirm = false; statusCode(401); } return $sendConfirm; /* Please see the API notes towards bottom for ways in which this function will change soon. */ }
function xmlrpc_clientSendWrite($method_name, $params) { $argToken =& $params[0]; $otherPartyUsername =& $params[1]; $sendMessage =& $params[2]; $tokenObject = new NodeToken(); $tokenObject->retrieveToken($argToken); $sourceUserId = $tokenObject->uid; $otherPartyUid = Planworld::nameToId($otherPartyUsername); $sendConfirm = Send::sendMessage($sourceUserId, $otherPartyUid, $sendMessage); return $sendConfirm; /* Add error checking and remote support (maybe included here), like every other routine above. */ /* BUG: sendConfirm is empty. See if we can fix that. Probably not. */ }