new PresencePlugin()
Constructor for Presence plugin.
Instance will be created each time when new WTAPI instance is created.
Plugin could be accessible thought WTAPI with presence property.
Plugin could be accessible thought WTAPI with presence property.
- Source:
- Tutorials:
Extends
- Observer
Methods
changePersonalPresence(presence, callback)
Parameters:
Name | Type | Description |
---|---|---|
presence |
WTAPI.Presence | |
callback |
function |
- Source:
get(user) → {WTAPI.Presence}
Returns the presence info for a particular user.
Parameters:
Name | Type | Description |
---|---|---|
user |
WTAPI.User |
- Source:
Returns:
- Type
- WTAPI.Presence
getPersonalPresence() → {WTAPI.Presence}
Returns a presence of current
- Source:
Returns:
- Type
- WTAPI.Presence
getSubscriptions(callback)
Retrieves a list of subscribed users (a list of users that send they presence).
All subscriptions (roster subscriptions and manual subscriptions) are returned to callback.
Parameters:
Name | Type | Description |
---|---|---|
callback |
SubscriptionsCallback |
- Source:
subscribe(extensions, callback)
Subscribe a specified extension for presence events.
Subscription will be removed when session is closed.
It is not necessary to subscribe to users that already in roster, because they already subscribed.
Parameters:
Name | Type | Description |
---|---|---|
extensions |
Array.<String> | |
callback |
function |
- Source:
unsubscribe(extensions, callback)
Remove previously subscribed user for current session.
When specified user already in roster, it is not possible to remove subscription from him.
Parameters:
Name | Type | Description |
---|---|---|
extensions |
Array.<String> | A list of extensions (user extensions) |
callback |
function |
- Source:
Events
personal_presence_changed
Indicates that personal presence has been changed.
Properties:
Name | Type | Description |
---|---|---|
presence |
WTAPI.Presence |
- Source:
presence_changed
Indicates that user has changed his presence.
Properties:
Name | Type | Description |
---|---|---|
user |
WTAPI.User | |
presence |
WTAPI.Presence |
- Source: