server Class Ape.subuser

Summary

File
<./src/Ape_Server/modules/libape-spidermonkey.c>

subuser Class Detail

Ape.subuser ()
An subuser object (tabbing in browser sessions).

The subuser object is available on registerCmd's callback.

Each time a client opens a new tab on the same application (or refreshes the page) a new subuser is created to represent this client's instance.

You can send a message directly to this subuser, or send a message to all others subuser.

File:
<./src/Ape_Server/modules/libape-spidermonkey.c>
Example
Ape.registerCmd('foo', true, function(params, info) {
	info.subuser.sendRaw('bar', {'ok':'true'});
});
See:
Ape.subuser.SendRaw
Ape.registerCmd

Summary

Own
Methods Attributes Methods Name Methods Description
<static>   Ape.subuser. getParent () Get the user object of a subuser.
<static>   Ape.subuser. sendRaw (name, data, options) Send a custom RAW to a subuser.

<static> {Ape.user} Ape.subuser. getParent ()

Get the user object of a subuser.
Returns:
Example
Ape.registerCmd('foo', true, function(params, info) {
	var user = info.subuser.getParent();
});
See:

<static> {void} Ape.subuser. sendRaw (name, data, options)

Send a custom RAW to a subuser.
Parameters:
{string} name The RAW name
{object} data An object that will be JSON encoded and send outh with the RAW
{object} options Optional
{pipe} options.from Optional An user pipe or a custom pipe that will be added in the from field, if an user pipe, the raw will not be sent to this user.
{user|subuser} options.restrict Optional A user (if sending to a channel), or a subuser (if sending to n user) which will not receive the raw.
Returns:
{void}
Example
Ape.registerCmd('foo', true, function(params, info) {
	info.subuser.sendRaw('bar', {'ok':'true'});
});
See: