2016-10-27 16:58:11 +13:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Actions and Action Creators
|
|
|
|
|
**/
|
|
|
|
|
|
2016-10-31 09:25:15 +13:00
|
|
|
export function setPort( port ){
|
2016-10-27 16:58:11 +13:00
|
|
|
return {
|
2016-10-31 09:25:15 +13:00
|
|
|
type: 'PUSHER_SET_PORT',
|
|
|
|
|
port: port
|
2016-10-27 16:58:11 +13:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-09 09:29:56 +13:00
|
|
|
export function setUsername( username ){
|
|
|
|
|
return {
|
|
|
|
|
type: 'PUSHER_SET_USERNAME',
|
|
|
|
|
username: username
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-27 16:58:11 +13:00
|
|
|
export function connect(){
|
|
|
|
|
return {
|
|
|
|
|
type: 'PUSHER_CONNECT'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function disconnect(){
|
|
|
|
|
return {
|
|
|
|
|
type: 'PUSHER_DISCONNECT'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-10 14:12:54 +13:00
|
|
|
export function startUpgrade(){
|
2016-10-29 22:40:02 +13:00
|
|
|
return {
|
2017-01-10 14:12:54 +13:00
|
|
|
type: 'START_UPGRADE'
|
2016-10-29 22:40:02 +13:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-09 09:29:56 +13:00
|
|
|
export function getConnections(){
|
2016-10-28 09:14:29 +13:00
|
|
|
return {
|
2017-02-19 21:27:43 +13:00
|
|
|
type: 'PUSHER_GET_CONNECTIONS'
|
2016-10-28 09:14:29 +13:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-09 09:29:56 +13:00
|
|
|
export function instruct( data = null ){
|
2016-10-27 16:58:11 +13:00
|
|
|
return {
|
|
|
|
|
type: 'PUSHER_INSTRUCT',
|
2016-10-28 09:14:29 +13:00
|
|
|
data: data
|
2016-10-27 16:58:11 +13:00
|
|
|
}
|
2016-12-05 10:20:01 +13:00
|
|
|
}
|
|
|
|
|
|
2017-03-09 08:04:23 +13:00
|
|
|
export function deliverBroadcast( data = null ){
|
|
|
|
|
return {
|
|
|
|
|
type: 'PUSHER_DELIVER_BROADCAST',
|
|
|
|
|
data: data
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-09 09:29:56 +13:00
|
|
|
export function sendAuthorization( recipient_connectionid, authorization, me ){
|
|
|
|
|
return {
|
2017-02-21 08:58:49 +13:00
|
|
|
type: 'PUSHER_DELIVER_MESSAGE',
|
2017-04-15 03:51:40 +12:00
|
|
|
data: {
|
|
|
|
|
to: recipient_connectionid,
|
|
|
|
|
message: {
|
|
|
|
|
type: 'spotify_authorization',
|
|
|
|
|
authorization: authorization,
|
|
|
|
|
me: me
|
|
|
|
|
}
|
2017-02-21 08:58:49 +13:00
|
|
|
}
|
2017-01-09 09:29:56 +13:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-20 16:58:20 +13:00
|
|
|
export function startRadio( uris ){
|
|
|
|
|
return {
|
2017-02-21 05:46:28 +13:00
|
|
|
type: 'PUSHER_START_RADIO',
|
2016-12-20 16:58:20 +13:00
|
|
|
uris: uris
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-12-20 19:54:19 +13:00
|
|
|
export function stopRadio(){
|
2016-12-20 16:58:20 +13:00
|
|
|
return {
|
2017-02-21 05:46:28 +13:00
|
|
|
type: 'PUSHER_STOP_RADIO'
|
2016-12-20 16:58:20 +13:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-02-21 05:46:28 +13:00
|
|
|
export function debug( message = null ){
|
2016-12-05 10:20:01 +13:00
|
|
|
return {
|
|
|
|
|
type: 'PUSHER_DEBUG',
|
2017-02-21 05:46:28 +13:00
|
|
|
message: message
|
2016-12-05 10:20:01 +13:00
|
|
|
}
|
2017-02-14 12:13:07 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function getQueueMetadata(){
|
|
|
|
|
return {
|
|
|
|
|
type: 'PUSHER_GET_QUEUE_METADATA'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function addQueueMetadata( tlids = [], from_uri = null ){
|
|
|
|
|
return {
|
|
|
|
|
type: 'PUSHER_ADD_QUEUE_METADATA',
|
|
|
|
|
tlids: tlids,
|
|
|
|
|
from_uri: from_uri
|
|
|
|
|
}
|
2016-10-27 16:58:11 +13:00
|
|
|
}
|