Module: SPIBase

A base implementation of the HipChat web client's SPI to be implemented by native/non-native consumers

Source:

Methods

(static) getNotificationPermission()

This method will be called to determine if the default notification permission banner should be displayed

Source:

(static) onLogMessage() → {*}

This method is called when web client logs a message. Note: this must be turned on via passing the config property - logging_enabled: true

Source:
Returns:
Type
*

(static) onNotification(notification) → {*}

This method will be called when a notification should be sent to the user

Parameters:
Name Type Description
notification Object

notification data

Properties
Name Type Description
jid string

the jid this notification is associated with

group_id number

the group_id for the notification

group_name string

the group_name for the notification

title string

the title text for this notification (room/sender name)

body string

the notification body

html_body string

the notification html_body

icon URL

an icon to use for this notification

notification_types Object

key/value pairs of notification types and their permission

Source:
Returns:
Type
*

(static) onPreferencesUpdated() → {*}

This method is called when a user preference has been changed

Source:
Returns:
Type
*

(static) onTotalUnreadCountUpdate(count, hasMention) → {*}

This method will be called when a notification should be sent to the user

Parameters:
Name Type Description
count Integer

the current unread message count

hasMention bool

if any of the unread messages include a user mention

Source:
Returns:
Type
*

(static) openExternalWindow(url, name, props) → {*}

This method is called when the web client wants to open a window in the browser. Note, this method is a replacement for the default browser window.open API. In most SPI implementations it will simply wrap window.open.

Parameters:
Name Type Description
url string

the url to open

name string

name of the new window

props string

see default window.open browser API for props

Source:
Returns:
Type
*

(static) openInternalWindow(url, name, props) → {*}

This method is called when the web client explicitly wants to open a new window owned by HipChat. To be used by video in order to launch a window inside the native wrapper and not the browser. If you would like to open a new browser window see openExternalWindow method.

Parameters:
Name Type Description
url string

the url to open

name string

name of the new window

props string

see default window.open browser API for props

Source:
Returns:
Type
*

(static) showFeedbackCollector(url) → {*}

This method is called when an external feedback collector is specified and the 'Provide Feedback' action is triggered by the user.

Parameters:
Name Type Description
url string

the feedback url to use

Source:
Returns:
Type
*

(static) showFileChooser() → {*}

This method is called when the web client is giving the user a file chooser interface

Source:
Returns:
Type
*

(static) showPreferencesDialog() → {*}

This method is called when a user chooses to show app preference dialog (or window if the implementation enables it)

Source:
Returns:
Type
*

(inner) buttonClickedProxySettings()

This method is called when the Proxy Settings button is clicked

Source:

(inner) focusApp()

Called when we want to bring the app to the foreground due to some activity (e.g. dropping a file on the app)

Source:

(inner) getLastServerUrl()

This method is called by the service selector when it is time to get the default value for lastServerUrl. It is native only.

Source:

(inner) onAppStateReady(config)

Fired when the preloader is dismissed and the application has fully loaded Is passed the completed application configuration, including preferences. See ConfigurationModel

Parameters:
Name Type Description
config ConfigurationModel
Source:

(inner) onCloudLoginShow()

This method is called by the service selector when the cloud login page is going to be shown. It is native only.

Source:

(inner) onDesktop4DialogShown()

This method is called when the Desktop 4 release dialog is shown

Source:

(inner) onHostRequestTimeout()

Called when web core requests begin timing out

Source:

(inner) onInternalTokenRefreshed(token)

This method is called when the internal token is updated

Parameters:
Name Type Description
token string

the new internal token data

Source:

(inner) onLegacyDownloadLinkClicked()

This method is called by the service selector when a user will be sent to download the legacy client. It is native only.

Source:

(inner) onLoginToAnotherTeam()

This method is called when a user select login into another team

Source:

(inner) onReconnectionError(error)

Fired when an error is caught when trying to re-establish a session on reconnection

Parameters:
Name Type Description
error string
Source:

(inner) onServerLoginShow()

This method is called by the service selector when the server login verification page is going to be shown. It is native only.

Source:

(inner) onServerOauthLogin()

This method is called by the service selector when it is time to do the server oauth login flow. It is native only.

Source:

(inner) onSignOut(hc, data)

This method is called when a user is signing out

Parameters:
Name Type Description
hc object

HipChat client instance

data object

sign out data

Source:

(inner) onStropheAuthFailed(error)

Fired when Strophe returns a status of CONNFAIL or AUTHFAIL with a condition when the connection changes

Parameters:
Name Type Description
error string
Source:

(inner) onStropheConnectionFailed(error)

Fired when Strophe returns a status of CONNFAIL or AUTHFAIL without a condition when the connection changes

Parameters:
Name Type Description
error string
Source:

(inner) onStrophePolicyViolation(data)

Fired when Strophe hits the 10 concurrent client max and session limit is reached.

Parameters:
Name Type Description
data object
Properties
Name Type Description
reason string
web_server string
Source:

(inner) onUnrecoverableError(type)

This method is called when an unrecoverable error is encountered

Parameters:
Name Type Description
type string

the error type encountered

Source: